com.partnersoft.v3x.io.formats.rover
Class RoverBundle

java.lang.Object
  extended by com.partnersoft.v3x.io.formats.rover.RoverBundle
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
RoverBundleInMemory

public class RoverBundle
extends java.lang.Object
implements java.io.Serializable

A single combination of a RoverFile and ObjectDump datafile+indexfile. Used to store a single chunk of (presumably homogenous) rover data; e.g. for GPS display or whatever. Example of usage:

 RoverPoint point = new RoverPoint(1, 500.0 340.0);
 ArrayList data = new ArrayList();
 data.add("Here's some data for the point");
 RoverBundle bundle = new RoverBundle("/tmp/test/rover/MyBundle");
 bundle.clear(); // if we don't do this we're appending
 bundle.addRoverData(point, data);
 bundle.close();
 

See Also:
Serialized Form

Constructor Summary
RoverBundle()
          Creates an uninitialized RoverBundle
RoverBundle(java.lang.String path)
          Creates a RoverBundle pointing at the given path (path is the path of the files minus their extensions).
 
Method Summary
 void addRoverData(byte[] roverBytes, java.util.ArrayList data)
          Adds a rover bytestream and its data.
 void addRoverData(byte[] roverBytes, java.util.ArrayList labels, java.util.ArrayList data)
          Adds a rover bytestream and its data.
 void addRoverData(RoverGraphic graphic, java.util.ArrayList data)
          Adds a single rover entity and its data.
 void addRoverData(RoverGraphic graphic, java.util.ArrayList labels, java.util.ArrayList data)
          Adds a single rover entity and its data.
 void appendData(RoverData data)
           
 void clear()
          Removes all data (rover and object).
 void close()
          Flushes and closes any open files.
 RoverData getData(int ID)
           
 DoubleRectangle getExtents()
          Returns the extents for the bundle.
 java.lang.String getName()
           
 int getNextID()
           
 ObjectDump getObjectDump()
          Returns the ObjectDump in this bundle; creates it if necessary.
 java.io.File getRoverFile()
          The actual File corresponding to the Rover data.
 java.io.InputStream getRoverIn()
          Returns an input stream for the rover.
 void setName(java.lang.String newName)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoverBundle

public RoverBundle()
Creates an uninitialized RoverBundle


RoverBundle

public RoverBundle(java.lang.String path)
Creates a RoverBundle pointing at the given path (path is the path of the files minus their extensions).

Method Detail

clear

public void clear()
           throws java.io.IOException
Removes all data (rover and object).

Throws:
java.io.IOException

addRoverData

public void addRoverData(RoverGraphic graphic,
                         java.util.ArrayList data)
                  throws java.io.IOException
Adds a single rover entity and its data.

Throws:
java.io.IOException

addRoverData

public void addRoverData(RoverGraphic graphic,
                         java.util.ArrayList labels,
                         java.util.ArrayList data)
                  throws java.io.IOException
Adds a single rover entity and its data.

Throws:
java.io.IOException

addRoverData

public void addRoverData(byte[] roverBytes,
                         java.util.ArrayList data)
                  throws java.io.IOException
Adds a rover bytestream and its data.

Throws:
java.io.IOException

addRoverData

public void addRoverData(byte[] roverBytes,
                         java.util.ArrayList labels,
                         java.util.ArrayList data)
                  throws java.io.IOException
Adds a rover bytestream and its data.

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Flushes and closes any open files.

Throws:
java.io.IOException

getRoverFile

public java.io.File getRoverFile()
The actual File corresponding to the Rover data. Creates it if necessary.


getObjectDump

public ObjectDump getObjectDump()
Returns the ObjectDump in this bundle; creates it if necessary.


getNextID

public int getNextID()

appendData

public void appendData(RoverData data)

getRoverIn

public java.io.InputStream getRoverIn()
                               throws java.io.IOException
Returns an input stream for the rover.

Throws:
java.io.IOException

getData

public RoverData getData(int ID)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String newName)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getExtents

public DoubleRectangle getExtents()
Returns the extents for the bundle.