jasi.sim.geo.cartesian
Class SpaceVec.IndexComparator

java.lang.Object
  extended by jasi.sim.geo.cartesian.SpaceVec.IndexComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<SpaceVec>
Enclosing class:
SpaceVec

public static final class SpaceVec.IndexComparator
extends java.lang.Object
implements java.util.Comparator<SpaceVec>, java.io.Serializable

Comparison function, which imposes a total ordering of space vectors by selecting one of the components of the space vector.

See Also:
Serialized Form

Field Summary
static int X
          The x-component.
static int Y
          The x-component.
static int Z
          The x-component.
 
Constructor Summary
SpaceVec.IndexComparator(int component)
          Constructor of this component comparator.
 
Method Summary
 int compare(SpaceVec s1, SpaceVec s2)
          Compares its two arguments for order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

X

public static final int X
The x-component.

See Also:
Constant Field Values

Y

public static final int Y
The x-component.

See Also:
Constant Field Values

Z

public static final int Z
The x-component.

See Also:
Constant Field Values
Constructor Detail

SpaceVec.IndexComparator

public SpaceVec.IndexComparator(int component)
Constructor of this component comparator.

Parameters:
component - The component of the space vectors to be compared.
Method Detail

compare

public int compare(SpaceVec s1,
                   SpaceVec s2)
Compares its two arguments for order.

Specified by:
compare in interface java.util.Comparator<SpaceVec>
Parameters:
s1 - The first object to be compared.
s2 - The second object to be compared.
Returns:
A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.