Package uk.ac.starlink.ttools.plot
Class Corner
- java.lang.Object
-
- uk.ac.starlink.ttools.plot.Corner
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Corner other)
Defines some arbitrary but consistent ordering of corners.boolean
equals(java.lang.Object other)
Corner[]
getAdjacent()
Returns an array of the three corners which are adjacent to this one (connected by a cube edge).static Corner
getCorner(int index)
Factory method giving one of the cube corners.boolean[]
getFlags()
Returns an array of boolean flags; thei
'th flag indicates whether thei
'th coordinate is low or high (zero or one for a unit cube).int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
COUNT
public static final int COUNT
Number of corners in a cube (8).- See Also:
- Constant Field Values
-
ORIGIN
public static final Corner ORIGIN
The origin.
-
-
Method Detail
-
getAdjacent
public Corner[] getAdjacent()
Returns an array of the three corners which are adjacent to this one (connected by a cube edge).- Returns:
- 3-element corner array
-
getFlags
public boolean[] getFlags()
Returns an array of boolean flags; thei
'th flag indicates whether thei
'th coordinate is low or high (zero or one for a unit cube).- Returns:
- three element array of booleans describing coordinates of this corner
-
getCorner
public static Corner getCorner(int index)
Factory method giving one of the cube corners. Theindex
determines which corner you get.- Parameters:
index
- corner ID; 0 <= index < 8
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-