|
||||||||||
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.var.AbstractVar<java.lang.Byte>
org.magnos.data.var.ByteVar
public class ByteVar
A Var with a byte value.
Field Summary | |
---|---|
static int |
SIZE
|
Constructor Summary | |
---|---|
ByteVar()
Instantiates a new ByteVar. |
|
ByteVar(byte value)
Instantiates a new ByteVar. |
|
ByteVar(Store store,
int location)
Instantiates a new ByteVar. |
|
ByteVar(Store store,
int location,
byte value)
Instantiates a new ByteVar. |
Method Summary | |
---|---|
byte |
add(byte x)
Adds the given value to this var and returns the result. |
Data |
copy()
Creates a clone of this data. |
byte |
get()
Returns the current value of the var. |
java.lang.Byte |
getValue()
Returns the value of this var as it was the last time this variable was read from a store at the location (and maybe with an offset) or as it was set with the setValue method. |
byte |
max(byte x)
Sets the var to the max between this var and the value. |
byte |
min(byte x)
Sets the var to the min between this var and the value. |
byte |
mul(byte x)
Multiplies the given value to this var and returns the result. |
void |
onRead(int location,
Store store)
Reads this data from the given store at the given location. |
void |
onWrite(int location,
Store store)
Writes this data to the given store at the given location. |
void |
put(byte value)
Sets the value of this var and writes it to the store. |
void |
set(byte value)
Sets the value of this var, but does not write it to the store. |
void |
setValue(java.lang.Byte value)
Sets the value of this var without writing the value to a store. |
byte |
take()
Returns the value of this var by first reading it from the store. |
Methods inherited from class org.magnos.data.var.AbstractVar |
---|
equals, hashCode, putValue, takeValue, toString |
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, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.magnos.data.Data |
---|
getActualLocation, getLocation, getParent, getSize, getStore, read, read, read, read, setLocation, setParent, setStore, write, write, write, write |
Field Detail |
---|
public static final int SIZE
Constructor Detail |
---|
public ByteVar()
public ByteVar(byte value)
value
- The initial value.public ByteVar(Store store, int location)
store
- The intial store.location
- The intial location.public ByteVar(Store store, int location, byte value)
store
- The initial store.location
- The initial location.value
- The initial value.Method Detail |
---|
public byte get()
public byte add(byte x)
x
- The value to add to this var.
public byte max(byte x)
x
- The value to take the max of with this var.
public byte min(byte x)
x
- The value to take the min of with this var.
public byte mul(byte x)
x
- The value to multiply by this var.
public void set(byte value)
value
- The new value.public void put(byte value)
value
- The new value.public byte take()
public java.lang.Byte getValue()
public void setValue(java.lang.Byte value)
value
- The new value to set.public 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.public 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |