|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.magnos.data.AbstractData
public abstract class AbstractData
An abstract implementation of Data.
Constructor Summary | |
---|---|
AbstractData(int size)
Instantiates a new AbstractData. |
Method Summary | |
---|---|
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. |
protected abstract void |
onRead(int location,
Store store)
Reads this data from the given store at the given location. |
protected abstract void |
onWrite(int location,
Store store)
Writes this data to the given store at the given location. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.magnos.data.Data |
---|
copy |
Constructor Detail |
---|
public AbstractData(int size)
size
- The size of the data in bytes.Method Detail |
---|
protected abstract void onRead(int location, Store store)
location
- The offset in bytes from the beginning of the store to read from.store
- The store to read from.protected abstract void onWrite(int location, Store store)
location
- The offset in bytes from the beginning of the store to write to.store
- The store to write to.public final void setLocation(int newLocation)
setLocation
in interface Data
newLocation
- The offset in bytes from beginning of the store.public final int getLocation()
getLocation
in interface Data
public final int getSize()
getSize
in interface Data
public final void setStore(Store newStore)
setStore
in interface Data
newStore
- The new store of this variable.public final Store getStore()
getStore
in interface Data
public final Data getParent()
getParent
in interface Data
public final void setParent(Data parent)
setParent
in interface Data
parent
- The parent Data object.public final int getActualLocation()
getActualLocation
in interface Data
public final void read()
read
in interface Data
public final void read(int offset)
read
in interface Data
offset
- The offset from the location to read the value.public final void read(Store store)
read
in interface Data
store
- The store to read from.public final void read(int offset, Store store)
read
in interface Data
offset
- The offset from the location to read the value.store
- The store to read from.public final void write()
write
in interface Data
public final void write(int offset)
write
in interface Data
offset
- The offset from the location to write the value.public final void write(Store store)
write
in interface Data
store
- The store to write to.public final void write(int offset, Store store)
write
in interface Data
offset
- The offset from the location to write the value.store
- The store to write to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |