Class Region
- java.lang.Object
-
- org.terracotta.offheapstore.util.AATreeSet.AbstractTreeNode<Region>
-
- org.terracotta.offheapstore.storage.allocator.Region
-
- All Implemented Interfaces:
java.lang.Comparable<java.lang.Comparable<?>>,AATreeSet.Node<Region>
class Region extends AATreeSet.AbstractTreeNode<Region> implements java.lang.Comparable<java.lang.Comparable<?>>
Class that represents the regions held within this set.
-
-
Field Summary
Fields Modifier and Type Field Description private intavailableBitSetprivate intendprivate intstart
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intavailable()(package private) intavailableHere()intcompareTo(java.lang.Comparable<?> other)Order this region relative to another.intend()booleanequals(java.lang.Object other)RegiongetPayload()inthashCode()protected booleanisNull()voidmerge(Region r)Merge the supplied region into this region (if they are adjoining).Regionremove(Region r)voidsetLeft(AATreeSet.Node<Region> l)voidsetRight(AATreeSet.Node<Region> r)intsize()Returns the size of this range (the number of values within its bounds).intstart()Returns the start of this range (inclusive).voidswapPayload(AATreeSet.Node<Region> other)java.lang.StringtoString()(package private) inttreeSize()booleantryMerge(Region r)private voidupdateAvailable()-
Methods inherited from class org.terracotta.offheapstore.util.AATreeSet.AbstractTreeNode
decrementLevel, getLeft, getLevel, getRight, incrementLevel, setLevel
-
-
-
-
Constructor Detail
-
Region
Region(int value)
-
Region
Region(int start, int end)Creates a region containing the given range of values (inclusive).
-
Region
Region(Region r)
Create a shallow copy of a region.The new Region has NULL left and right children.
-
-
Method Detail
-
available
int available()
-
updateAvailable
private void updateAvailable()
-
availableHere
int availableHere()
-
setLeft
public void setLeft(AATreeSet.Node<Region> l)
- Specified by:
setLeftin interfaceAATreeSet.Node<Region>- Overrides:
setLeftin classAATreeSet.AbstractTreeNode<Region>
-
setRight
public void setRight(AATreeSet.Node<Region> r)
- Specified by:
setRightin interfaceAATreeSet.Node<Region>- Overrides:
setRightin classAATreeSet.AbstractTreeNode<Region>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
size
public int size()
Returns the size of this range (the number of values within its bounds).
-
isNull
protected boolean isNull()
-
treeSize
int treeSize()
-
merge
public void merge(Region r)
Merge the supplied region into this region (if they are adjoining).- Parameters:
r- region to merge
-
tryMerge
public boolean tryMerge(Region r)
-
compareTo
public int compareTo(java.lang.Comparable<?> other)
Order this region relative to another.- Specified by:
compareToin interfacejava.lang.Comparable<java.lang.Comparable<?>>
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getPayload
public Region getPayload()
- Specified by:
getPayloadin interfaceAATreeSet.Node<Region>
-
swapPayload
public void swapPayload(AATreeSet.Node<Region> other)
- Specified by:
swapPayloadin interfaceAATreeSet.Node<Region>
-
start
public int start()
Returns the start of this range (inclusive).
-
end
public int end()
-
-