edu.mit.sketch.geom
Class Range

java.lang.Object
  |
  +--edu.mit.sketch.geom.Range
All Implemented Interfaces:
Comparator
Direct Known Subclasses:
Segment

public class Range
extends Object
implements Comparator

This class represents a Point described by a java.awt.geom.Line2D.Double


Field Summary
 int max
          Upper bound of the range
 int min
          Lower bound of the range
 
Constructor Summary
Range()
          The constructor.
Range(int min, int max)
          The constructor.
 
Method Summary
static Range[] appendRanges(Range[] ranges, Range range)
          Append the ranges with the input range
static Range[] cloneRanges(Range[] ranges)
          For obtaining a complete copy of an array of Ranges objects.
 int compare(Object o1, Object o2)
          Implement comparator Warning: The ranges should be non-overlapping for proper sorting.
 boolean equals(Object o1)
          Implement comparator Warning: The ranges should be non-overlapping for proper sorting.
 String toString()
          Override toString
static Range[] vectorToArray(Vector ranges)
          Returns an array containing the elements of the Vector.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

min

public int min
Lower bound of the range

max

public int max
Upper bound of the range
Constructor Detail

Range

public Range()
The constructor.

Range

public Range(int min,
             int max)
The constructor.
Method Detail

toString

public String toString()
Override toString
Overrides:
toString in class Object

vectorToArray

public static Range[] vectorToArray(Vector ranges)
Returns an array containing the elements of the Vector.

compare

public int compare(Object o1,
                   Object o2)
Implement comparator Warning: The ranges should be non-overlapping for proper sorting.
Specified by:
compare in interface Comparator

equals

public boolean equals(Object o1)
Implement comparator Warning: The ranges should be non-overlapping for proper sorting.
Specified by:
equals in interface Comparator
Overrides:
equals in class Object

appendRanges

public static Range[] appendRanges(Range[] ranges,
                                   Range range)
Append the ranges with the input range

cloneRanges

public static Range[] cloneRanges(Range[] ranges)
For obtaining a complete copy of an array of Ranges objects.