com.bbn.openmap.layer.vpf
Class CoordFloatString

java.lang.Object
  extended bycom.bbn.openmap.layer.vpf.CoordFloatString

public class CoordFloatString
extends java.lang.Object

Encapsulate the VPF Float Coordinate String primitive datatype.


Field Summary
 int tcount
          the number of tuples
 int tsize
          the number of elements in a tuple
 float[] vals
          where we store the data as x1,y1,z1,x2,y2,z2,...
 
Constructor Summary
CoordFloatString(int tuplecount, int tuplesize, BinaryFile input)
          Construct a CoordFloatString from a file input
 
Method Summary
 float getasFloat(int tuple, int val)
          Get a value in a tuple
 float[] getasFloatV(int tuple)
          Get a tuple
 float getXasFloat(int tuple)
          Get the first value of a tuple
 float getYasFloat(int tuple)
          Get the second value of a tuple
 float getZasFloat(int tuple)
          Get the third value of a tuple
 int maxIndex()
          The maximum indexable tuple value
 java.lang.String toString()
          A pretty formatter for the floatstring
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tcount

public int tcount
the number of tuples


tsize

public int tsize
the number of elements in a tuple


vals

public float[] vals
where we store the data as x1,y1,z1,x2,y2,z2,...

Constructor Detail

CoordFloatString

public CoordFloatString(int tuplecount,
                        int tuplesize,
                        BinaryFile input)
                 throws FormatException
Construct a CoordFloatString from a file input

Parameters:
tuplecount - the number of tuples to read from the input stream
tuplesize - the number of floats in the tuple
input - the input stream to read everything from
Throws:
FormatException - if we have IO errors or premature end-of-file
Method Detail

maxIndex

public int maxIndex()
The maximum indexable tuple value

Returns:
the maximum valid tuple index

toString

public java.lang.String toString()
A pretty formatter for the floatstring

Returns:
a pretty string of the tuple

getXasFloat

public float getXasFloat(int tuple)
Get the first value of a tuple

Parameters:
tuple - the index of the tuple
Returns:
the first value of the tuple given by tuple

getYasFloat

public float getYasFloat(int tuple)
Get the second value of a tuple

Parameters:
tuple - the index of the tuple
Returns:
the second value of the tuple given by tuple

getZasFloat

public float getZasFloat(int tuple)
Get the third value of a tuple

Parameters:
tuple - the index of the tuple
Returns:
the third value of the tuple given by tuple

getasFloatV

public float[] getasFloatV(int tuple)
Get a tuple

Parameters:
tuple - the index of the tuple
Returns:
the tuple given by tuple

getasFloat

public float getasFloat(int tuple,
                        int val)
Get a value in a tuple

Parameters:
tuple - the index of the tuple
val - the index of the value
Returns:
the tuple given by tuple


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details