jasi.sim.geo.cartesian
Class Space.Distance

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

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

Distance function, which imposes a total ordering by comparing the distance to a center.

See Also:
Serialized Form

Constructor Summary
Space.Distance(Space center)
          Constructor.
 
Method Summary
 int compare(Space s1, Space 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
 

Constructor Detail

Space.Distance

public Space.Distance(Space center)
Constructor.

Parameters:
center - The center of the distances.
Method Detail

compare

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

Specified by:
compare in interface java.util.Comparator<Space>
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.