|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.olduvai.accordiondrawer.SplitLine
public class SplitLine
An instance of a SplitLine. Note that the comparator uses the absoluteValue of this object. This code also implements the TreeSet lookup hack, which allows for the retrieving of an object in the TreeSet using the 'contains' method call on the tree. Note that this hack is not thread safe. This class must be kept lightweight with respect to state, as there may be many of them in some applications.
Field Summary | |
---|---|
protected double |
absoluteValue
Absolute value, between 0 and 1, between SplitAxis.minStuckLine and SplitAxis.maxStuckLine . |
protected boolean |
color
State for red-black tree. |
protected int |
computedFrame
Current frame for rendering, monotonically increasing, for determining validity of absoluteValue (caching). |
java.lang.Object |
cullingObject
An object to assist with aggregation when multiple splitcells are hidden under a single pixel. |
static boolean |
getSplitLine
Global static variable for retrieving a split line from the split axis. |
private boolean |
isFakeLine
State for fake lines or real lines. |
private SplitLine |
leftChild
Left child of this split line, null if the child is null (possible leaf is right is also null). |
private SplitLine |
opBound
Off-parent bound of this split line, null if this is the root. |
private SplitLine |
parent
Parent of this split line, null if this is the root. |
protected double |
relativeValue
Relative value, between 0 and 1, between opBound and parent , the bounds for this split line. |
private SplitLine |
rightChild
Right child of this split line, null if the child is null (possible leaf is left is also null). |
java.lang.Object |
rowObject
An object that stores a 'row' of data. |
static SplitLine |
splitLineFound
Global static variable for storing a found split line from the split axis. |
protected int |
subTreeSize
How many nodes are below me, including me (1 for leaves). |
Constructor Summary | |
---|---|
SplitLine()
Default split line constructor. |
|
SplitLine(double value,
SplitLine parent,
SplitLine opAncestor,
boolean isVirtual)
Make a new splitline with given key, value, and parent, and with null child links, and BLACK color. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
Compares absolute values of two SplitLines. |
boolean |
equals(java.lang.Object o)
Note: natural ordering is NOT consistent with equals. |
double |
getCachedValue()
Returns the cached value of the line without checking if it is up to date. |
java.lang.Object |
getCullingObject()
Accessor for cullingObject . |
SplitLine |
getLeftChild()
Accessor for left child. |
SplitLine |
getOpBound()
Accessor for opBound . |
static SplitLine |
getOverlapSplitCell(java.util.TreeSet searchTree,
SplitLine input)
Returns a SplitLine whose absoluteValue is either equal to the input SplitLine's absoluteValue, or is the closest SplitLine less than the input SplitLine's absoluteValue. |
SplitLine |
getParent()
Accessor for parent object. |
SplitLine |
getRightChild()
Accessor for right child. |
java.lang.Object |
getRowObject()
Accessor for rowObject . |
int |
getSubTreeSize()
Accessor for subTreeSize . |
double |
getValue(SplitAxis axis,
int frameNum)
Returns the absolute value of this splitLine. |
boolean |
isLeftChild()
Test function for internal nodes, true if this line is a left child of its immediate parent. |
boolean |
isRoot()
Root test. |
void |
setCullingObject(java.lang.Object cullingObject)
Modifier for cullingObject . |
void |
setLeftChild(SplitLine s)
Modifier for left child. |
void |
setOpBound(SplitLine opBound)
Modifier for opBound . |
void |
setParent(SplitLine s)
Modifier for parent object. |
void |
setRightChild(SplitLine s)
Modifier for right child. |
void |
setRowObject(java.lang.Object rowObject)
Modifier for rowObject . |
void |
setSubTreeSize(int subTreeSize)
Modifier for subTreeSize . |
java.lang.String |
toLongString()
Recursive descent print: For printing the split axis tree under this node (recursive). |
java.lang.String |
toString()
String representation of this split line. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private boolean isFakeLine
public static boolean getSplitLine
compareTo(Object)
, which does not have a return value, but sets a value for splitLineFound
if this is true.
public static SplitLine splitLineFound
compareTo(Object)
, which does not have a return value, but sets this if getSplitLine
is true.
private SplitLine leftChild
private SplitLine rightChild
private SplitLine parent
private SplitLine opBound
absoluteValue
with the hierarchy of relativeValue
protected boolean color
SplitAxis.BLACK
or SplitAxis.RED
.
protected double relativeValue
opBound
and parent
, the bounds for this split line.
protected double absoluteValue
SplitAxis.minStuckLine
and SplitAxis.maxStuckLine
.
protected int computedFrame
absoluteValue
(caching).
protected int subTreeSize
public java.lang.Object cullingObject
CellGeom
or other application-specific objects.
public java.lang.Object rowObject
Constructor Detail |
---|
public SplitLine()
public SplitLine(double value, SplitLine parent, SplitLine opAncestor, boolean isVirtual)
isVirtual
- true for virtual split lines, created for rendering but not added to the split axis hierarchy.value
- initial absoluteValue
value for this split line. Will be used to place and determine relative value.parent
- parent
split lineopAncestor
- opposite split line, opBound
Method Detail |
---|
public SplitLine getParent()
parent
.public void setParent(SplitLine s)
s
- new parent
for this line.public SplitLine getLeftChild()
leftChild
.public void setLeftChild(SplitLine s)
s
- New leftChild
for this line.public SplitLine getRightChild()
rightChild
.public void setRightChild(SplitLine s)
s
- New rightChild
for this line.public double getValue(SplitAxis axis, int frameNum)
axis
- the axis to use for computing the value for this line.frameNum
- the frame number to check if computing the position is required (or if cache is safe)
public double getCachedValue()
getValue(SplitAxis, int)
is much safer if the real position of the line is required.
absoluteValue
.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- Second object to test for equality.
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toLongString()
SplitAxis.print(String)
on the root node.
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- Second split line to test position.
public static SplitLine getOverlapSplitCell(java.util.TreeSet searchTree, SplitLine input)
searchTree
- Tree of split lines to test, usually a partitioned set of split lines (set covers whole space between SplitAxis.minStuckLine
and SplitAxis.maxStuckLine
.input
- Split line to locate within searchTree (should bounded by exactly one split line in the tree)
public int getSubTreeSize()
subTreeSize
.
public void setSubTreeSize(int subTreeSize)
subTreeSize
.
subTreeSize
- The subTreeSize to set.public java.lang.Object getCullingObject()
cullingObject
. Should be cast later for application-specific use.
public void setCullingObject(java.lang.Object cullingObject)
cullingObject
. Generic object, application-specific use for culling.
cullingObject
- The cullingObject to set.public java.lang.Object getRowObject()
rowObject
.
public void setRowObject(java.lang.Object rowObject)
rowObject
.
rowObject
- The rowObject to set.public boolean isLeftChild()
public SplitLine getOpBound()
opBound
.
public void setOpBound(SplitLine opBound)
opBound
.
opBound
- The opBound to set.public boolean isRoot()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |