vec_math
Class LineVector

java.lang.Object
  extended by vec_math.VectorG
      extended by vec_math.LineVector
All Implemented Interfaces:
Serializable, Cloneable

public class LineVector
extends VectorG

A class that converts a string consiting of individual tokens into a VectorG of doubles. Different delimiter chars can be specified.

See Also:
StringTool, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class vec_math.VectorG
VectorG.CloneTest, VectorG.EuclidianMetric, VectorG.LengthComparator, VectorG.Metric
 
Field Summary
private static DecimalFormat DEFFORMAT
          The default number format to use in converting the vector in a string.
private static NumberFormat format
          The number format to use.
 
Fields inherited from class vec_math.VectorG
a
 
Constructor Summary
  LineVector(String line)
          Converts a line into a vector of doubles.
  LineVector(String line, String delim)
          Converts a line into a vector of doubles using the specified delimiters.
protected LineVector(StringTokenizer breakup)
          Uses the string tokenizer to derive a double vector.
 
Method Summary
static void setFormat(NumberFormat use)
          Sets the decimal number formatter to use on string output.
 String toString()
          The string representation of a line vector.
static String toString(VectorG n)
          The string representation of a line vector.
 
Methods inherited from class vec_math.VectorG
add, clone, dimension, direct, directDivide, directMultiply, dot, doubleParse, equalData, equals, fillFrom, fillFrom, fromDoubles, fromString, get, getAsArray, getLength, hashCode, match, match, multiply, parse, search, searchMinMax, set, sort, sortToLength, subtract
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFFORMAT

private static final DecimalFormat DEFFORMAT
The default number format to use in converting the vector in a string.


format

private static NumberFormat format
The number format to use. Defaults to DEFFORMAT.

Constructor Detail

LineVector

public LineVector(String line)
Converts a line into a vector of doubles. Standard delimiters, as defined in the string tokenizer class, are used.

Parameters:
line - The tokenizable string.

LineVector

public LineVector(String line,
                  String delim)
Converts a line into a vector of doubles using the specified delimiters.

Parameters:
line - The tokenizable string.
delim - The delimiters to use, see StringTool.

LineVector

protected LineVector(StringTokenizer breakup)
Uses the string tokenizer to derive a double vector.

Method Detail

setFormat

public static void setFormat(NumberFormat use)
Sets the decimal number formatter to use on string output.


toString

public String toString()
The string representation of a line vector. It differs in the string representation in the way that all vector elements are combined to a single line separated by spaces. This line can, in turn, be used to construct a new line vector.

Overrides:
toString in class VectorG

toString

public static String toString(VectorG n)
The string representation of a line vector. It differs in the string representation in the way that all vector elements are combined to a single line separated by spaces. This line can, in turn, be used to construct a new line vector.