|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.magnos.data.AbstractData
org.magnos.data.DataSet
public class DataSet
A set of data pieces.
Constructor Summary | |
---|---|
DataSet(DataSet set)
Instantiates a new DataSet. |
|
DataSet(int size)
Instantiates a new DataSet. |
Method Summary | ||
---|---|---|
void |
add(Data... datas)
Adds a piece of data to this set. |
|
Data |
copy()
Creates a clone of this data. |
|
static DataSet |
create(Data... data)
Creates a DataSet with the given array of data. |
|
|
get(int index)
Gets the data element at the given index. |
|
int |
getSetSize()
Returns the current or actual size of the DataSet. |
|
protected void |
onRead(int location,
Store store)
Reads this data from the given store at the given location. |
|
protected void |
onWrite(int location,
Store store)
Writes this data to the given store at the given location. |
Methods inherited from class org.magnos.data.AbstractData |
---|
getActualLocation, getLocation, getParent, getSize, getStore, read, read, read, read, setLocation, setParent, setStore, write, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSet(int size)
size
- The fixed size of the DataSet in bytes.public DataSet(DataSet set)
set
- A DataSet to copy data from.Method Detail |
---|
public void add(Data... datas)
datas
- The data to add to the set.
java.lang.RuntimeException
- The data was to large to add to this set.public <T extends Data> T get(int index)
T
- The element retrieved from the list is cast to this type.index
- The index of the data in this set.
java.lang.IndexOutOfBoundsException
- No data exists at the given index.public int getSetSize()
protected void onRead(int location, Store store)
onRead
in class AbstractData
location
- The offset in bytes from the beginning of the store to read from.store
- The store to read from.protected void onWrite(int location, Store store)
onWrite
in class AbstractData
location
- The offset in bytes from the beginning of the store to write to.store
- The store to write to.public Data copy()
public static DataSet create(Data... data)
data
- The data to add to the DataSet.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |