uk.ac.starlink.ttools.plot
Class Corner

java.lang.Object
  extended by uk.ac.starlink.ttools.plot.Corner
All Implemented Interfaces:
Comparable

public class Corner
extends Object
implements Comparable

Describes the corners of a 3-dimensional cube.

Since:
22 Nov 2005
Author:
Mark Taylor

Field Summary
static int COUNT
          Number of corners in a cube (8).
static Corner ORIGIN
          The origin.
 
Method Summary
 int compareTo(Object other)
          Defines some arbitrary but consistent ordering of corners.
 boolean equals(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; the i'th flag indicates whether the i'th coordinate is low or high (zero or one for a unit cube).
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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; the i'th flag indicates whether the i'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. The index determines which corner you get.

Parameters:
index - corner ID; 0 <= index < 8

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Object other)
Defines some arbitrary but consistent ordering of corners.

Specified by:
compareTo in interface Comparable


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.