org.magnos.data
Interface Data

All Known Subinterfaces:
Var<E>
All Known Implementing Classes:
AbstractData, AbstractVar, BooleanVar, ByteVar, DataArray, DataSet, DoubleVar, FloatVar, IntVar, LongVar, ShortVar, StringVar, UByteVar, UIntVar, UShortVar

public interface Data

A fixed size chunk of data which can be read and written to and from a store.

Author:
Philip Diffenderfer

Method Summary
 Data copy()
          Creates a clone of this data.
 int getActualLocation()
          Returns the actual location of this Data in its store with respect to the parent if one exists.
 int getLocation()
          Returns the location in bytes of this variable in the store.
 Data getParent()
          Returns the parent Data object if one exists.
 int getSize()
          Returns the size of this variable in a store.
 Store getStore()
          Returns the store this variable is read and written to and from.
 void read()
          Reads the value from the store at the location.
 void read(int offset)
          Reads the value from the store at the location with the given offset.
 void read(int offset, Store store)
          Reads the value from the given store at the location with the given offset.
 void read(Store store)
          Reads the value from the given store at the location.
 void setLocation(int newLocation)
          Sets the location in bytes of this variable in the store.
 void setParent(Data parent)
          Sets the parent Data object.
 void setStore(Store newStore)
          Sets the store this variable is read and written to and from.
 void write()
          Writes the value to the store at the location.
 void write(int offset)
          Writes the value to the store at the location with the given offset.
 void write(int offset, Store store)
          Writes the value to the given store at the location with the given offset.
 void write(Store store)
          Writes the value to the given store at the location.
 

Method Detail

read

void read()
Reads the value from the store at the location.


read

void read(int offset)
Reads the value from the store at the location with the given offset.

Parameters:
offset - The offset from the location to read the value.

read

void read(Store store)
Reads the value from the given store at the location.

Parameters:
store - The store to read from.

read

void read(int offset,
          Store store)
Reads the value from the given store at the location with the given offset.

Parameters:
offset - The offset from the location to read the value.
store - The store to read from.

write

void write()
Writes the value to the store at the location.


write

void write(int offset)
Writes the value to the store at the location with the given offset.

Parameters:
offset - The offset from the location to write the value.

write

void write(Store store)
Writes the value to the given store at the location.

Parameters:
store - The store to write to.

write

void write(int offset,
           Store store)
Writes the value to the given store at the location with the given offset.

Parameters:
offset - The offset from the location to write the value.
store - The store to write to.

getSize

int getSize()
Returns the size of this variable in a store.

Returns:
The number of bytes this variable takes up in a store.

getLocation

int getLocation()
Returns the location in bytes of this variable in the store.

Returns:
The offset in bytes from the beginning of the store.

setLocation

void setLocation(int newLocation)
Sets the location in bytes of this variable in the store.

Parameters:
newLocation - The offset in bytes from beginning of the store.

getStore

Store getStore()
Returns the store this variable is read and written to and from.

Returns:
The reference to the store.

setStore

void setStore(Store newStore)
Sets the store this variable is read and written to and from.

Parameters:
newStore - The new store of this variable.

copy

Data copy()
Creates a clone of this data. The resulting data will be of the same type, have the same location, the same store, and have other similar attributes to this type.

Returns:
A clone of this data.

getParent

Data getParent()
Returns the parent Data object if one exists.

Returns:
The reference to the parent Data object.

setParent

void setParent(Data parent)
Sets the parent Data object.

Parameters:
parent - The parent Data object.

getActualLocation

int getActualLocation()
Returns the actual location of this Data in its store with respect to the parent if one exists.

Returns:
The actual location of the data in bytes.