rangesearch
Class JDSLUtil

java.lang.Object
  extended byrangesearch.JDSLUtil

public class JDSLUtil
extends java.lang.Object

Implements features which are not in JDSL.


Field Summary
protected static int TYPE_INT
           
protected static int TYPE_NULL
           
protected static int TYPE_RAT
           
 
Constructor Summary
JDSLUtil()
           
 
Method Summary
static jdsl.geomobj.api.Point2D loadPoint(java.io.StreamTokenizer st)
          Reads a point from a text stream.
static java.lang.String pointListToString(Point2DIterator pi)
          Converts an iterator over 2D points into a string.
static java.lang.String pointToString(jdsl.geomobj.api.Point2D p)
          Converts a point to a string representation.
static double readNumber(java.io.StreamTokenizer st)
          Helper function for loadPoint.
static void savePoint(java.io.Writer s, jdsl.geomobj.api.Point2D p)
          Writes a point to a text stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NULL

protected static final int TYPE_NULL
See Also:
Constant Field Values

TYPE_INT

protected static final int TYPE_INT
See Also:
Constant Field Values

TYPE_RAT

protected static final int TYPE_RAT
See Also:
Constant Field Values
Constructor Detail

JDSLUtil

public JDSLUtil()
Method Detail

pointListToString

public static java.lang.String pointListToString(Point2DIterator pi)
Converts an iterator over 2D points into a string.

Returns:
a string representation of the list of points, lexographically sorted from left to right, and from bottom to top in the case of a tie.

pointToString

public static java.lang.String pointToString(jdsl.geomobj.api.Point2D p)
Converts a point to a string representation.

Returns:
the string representation.

savePoint

public static void savePoint(java.io.Writer s,
                             jdsl.geomobj.api.Point2D p)
                      throws java.io.IOException
Writes a point to a text stream.

Throws:
java.io.IOException - if the point can't be written.

loadPoint

public static jdsl.geomobj.api.Point2D loadPoint(java.io.StreamTokenizer st)
                                          throws java.io.IOException
Reads a point from a text stream.

Throws:
java.io.IOException - if the point can't be read.

readNumber

public static double readNumber(java.io.StreamTokenizer st)
                         throws java.io.IOException
Helper function for loadPoint.

Returns:
the number read from the stream, in double form.
Throws:
java.io.IOException - if the number can't be read.