java.lang.Object
org.modama.ModelStates
org.modama.Model
org.modama.framework.AbstractFrameworkModel
org.modama.framework.entities.AbstractEntity
org.modama.framework.entities.AbstractEntityList
org.modama.framework.entities.NumberList
- public class NumberList
- extends AbstractEntityList
a list of numbers, internal the data is an array of doubles,
if needed a NumberEntity is created from the double value but you can also just use the array directly
(wich is more efficient)
|
Field Summary |
(package private) double[] |
data
the numbers |
|
Method Summary |
void |
add(AbstractEntity entity)
this is very slow, because the entire array has to be recopied, actualy you shouldnt use it |
void |
add(int index,
AbstractEntity entity)
this is very slow, because the entire array has to be recopied, actualy you shouldnt use it |
void |
clear()
|
protected void |
create()
create the empty numberarray |
void |
delete()
delete the entity from the world |
AbstractEntity |
get(int index)
|
java.lang.Object |
getData()
getter for data |
double[] |
getNumbers()
|
int |
getSize()
collection methods
some mehtods are not implemented, others are very slow, normaly you should direct use the data (an Array) |
boolean |
isEmpty()
get set methods |
boolean |
load(java.net.URL url)
tries to load the number from the url, expects just a simple string representing the number |
void |
remove(AbstractEntity entity)
not supported, throws an exception |
void |
remove(int index)
this is very slow, because the entire array has to be recopied, actualy you shouldnt use it |
void |
replace(int index,
AbstractEntity entity)
|
void |
save(java.net.URL url)
saves the number to a file using a FileWriter |
void |
setData(java.lang.Object data)
setter for data, cause fire |
void |
setNumbers(double[] d)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
data
double[] data
- the numbers
NumberList
public NumberList()
NumberList
public NumberList(java.lang.String initName)
create
protected void create()
- create the empty numberarray
- Overrides:
create in class AbstractEntity
delete
public void delete()
throws org.modama.framework.exceptions.DeleteCancelledException
- Description copied from class:
AbstractEntity
- delete the entity from the world
- Overrides:
delete in class AbstractEntity
load
public boolean load(java.net.URL url)
throws java.io.IOException
- tries to load the number from the url, expects just a simple string representing the number
save
public void save(java.net.URL url)
throws java.io.IOException
- saves the number to a file using a FileWriter
getSize
public int getSize()
- collection methods
some mehtods are not implemented, others are very slow, normaly you should direct use the data (an Array)
- Specified by:
getSize in class AbstractEntityList
add
public void add(AbstractEntity entity)
- this is very slow, because the entire array has to be recopied, actualy you shouldnt use it
- Specified by:
add in class AbstractEntityList
add
public void add(int index,
AbstractEntity entity)
- this is very slow, because the entire array has to be recopied, actualy you shouldnt use it
- Specified by:
add in class AbstractEntityList
remove
public void remove(AbstractEntity entity)
- not supported, throws an exception
- Specified by:
remove in class AbstractEntityList
remove
public void remove(int index)
- this is very slow, because the entire array has to be recopied, actualy you shouldnt use it
- Specified by:
remove in class AbstractEntityList
replace
public void replace(int index,
AbstractEntity entity)
- Specified by:
replace in class AbstractEntityList
get
public AbstractEntity get(int index)
- Specified by:
get in class AbstractEntityList
clear
public void clear()
- Specified by:
clear in class AbstractEntityList
isEmpty
public boolean isEmpty()
- get set methods
- Specified by:
isEmpty in class AbstractEntity
getData
public java.lang.Object getData()
- Description copied from class:
AbstractEntity
- getter for data
- Specified by:
getData in class AbstractEntity
setData
public void setData(java.lang.Object data)
- Description copied from class:
AbstractEntity
- setter for data, cause fire
- Specified by:
setData in class AbstractEntity
getNumbers
public double[] getNumbers()
setNumbers
public void setNumbers(double[] d)