Class Corner
java.lang.Object
uk.ac.starlink.ttools.plot.Corner
- All Implemented Interfaces:
Comparable<Corner>
Describes the corners of a 3-dimensional cube.
- Since:
- 22 Nov 2005
- Author:
- Mark Taylor
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintDefines some arbitrary but consistent ordering of corners.booleanCorner[]Returns an array of the three corners which are adjacent to this one (connected by a cube edge).static CornergetCorner(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).inthashCode()toString()
-
Field Details
-
COUNT
public static final int COUNTNumber of corners in a cube (8).- See Also:
-
ORIGIN
The origin.
-
-
Method Details
-
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
Factory method giving one of the cube corners. Theindexdetermines which corner you get.- Parameters:
index- corner ID; 0 <= index < 8
-
equals
-
hashCode
-
toString
-
compareTo
Defines some arbitrary but consistent ordering of corners.- Specified by:
compareToin interfaceComparable<Corner>
-