public class Region extends AATreeSet.AbstractTreeNode<Comparable> implements Comparable<Comparable>
Constructor and Description |
---|
Region(long value)
Creates a region containing just the single given value
|
Region(long start,
long end)
Creates a region containing the given range of value (inclusive).
|
Region(Region r)
Create a shallow copy of a region.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Comparable other)
Compare this node to the supplied 'data' object.
|
long |
contiguous()
Return the size of the largest region linked from this node.
|
long |
end()
Returns the end of this range (inclusive).
|
Region |
getPayload()
Return the 'value' object held within this node.
|
protected boolean |
isNull()
Return true if this region is null, i.e.
|
protected void |
merge(Region r)
Merge the supplied region into this region (if they are adjoining).
|
protected Region |
remove(Region r)
Remove the supplied region from this region.
|
void |
setLeft(AATreeSet.Node<Comparable> l)
Set this node's left child.
|
void |
setRight(AATreeSet.Node<Comparable> r)
Set this node's right child.
|
long |
size()
Returns the size of this range (the number of values within its bounds).
|
long |
start()
Returns the start of this range (inclusive).
|
void |
swapPayload(AATreeSet.Node<Comparable> other)
Swap the payload objects between this node and the supplied node.
|
String |
toString() |
decrementLevel, getLeft, getLevel, getRight, incrementLevel, setLevel
public Region(long value)
value
- public Region(long start, long end)
public Region(Region r)
The new Region has NULL left and right children.
public long contiguous()
public void setLeft(AATreeSet.Node<Comparable> l)
AATreeSet.AbstractTreeNode
setLeft
in interface AATreeSet.Node<Comparable>
setLeft
in class AATreeSet.AbstractTreeNode<Comparable>
public void setRight(AATreeSet.Node<Comparable> r)
AATreeSet.AbstractTreeNode
setRight
in interface AATreeSet.Node<Comparable>
setRight
in class AATreeSet.AbstractTreeNode<Comparable>
public long size()
protected boolean isNull()
protected Region remove(Region r) throws IllegalArgumentException
r
- region to removeIllegalArgumentException
- if this region does not completely enclose the supplied regionprotected void merge(Region r) throws IllegalArgumentException
r
- region to mergeIllegalArgumentException
- if the regions are not adjoiningpublic int compareTo(Comparable other)
compareTo
in interface Comparable<Comparable>
compareTo
in interface AATreeSet.Node<Comparable>
public void swapPayload(AATreeSet.Node<Comparable> other)
swapPayload
in interface AATreeSet.Node<Comparable>
public Region getPayload()
getPayload
in interface AATreeSet.Node<Comparable>
public long start()
public long end()
Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.