Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.modama.framework.entities
Class NumberList  view NumberList download NumberList.java

java.lang.Object
  extended byorg.modama.ModelStates
      extended byorg.modama.Model
          extended byorg.modama.framework.AbstractFrameworkModel
              extended byorg.modama.framework.entities.AbstractEntity
                  extended byorg.modama.framework.entities.AbstractEntityList
                      extended byorg.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
 
Fields inherited from class org.modama.framework.entities.AbstractEntityList
EVENT_ADD, EVENT_CLEAR, EVENT_REMOVE, EVENT_REPLACE
 
Fields inherited from class org.modama.framework.entities.AbstractEntity
fullName, ID, IDcnt, PROP_DATA, PROP_FULLNAME
 
Fields inherited from class org.modama.framework.AbstractFrameworkModel
name, PROP_NAME
 
Fields inherited from class org.modama.Model
changeAgent, EVENT_FIRED, state
 
Fields inherited from class org.modama.ModelStates
CREATED, DELETED, MODIFIED, SAVED
 
Constructor Summary
NumberList()
           
NumberList(java.lang.String initName)
           
 
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 org.modama.framework.entities.AbstractEntity
getFullName, getID, setFullName
 
Methods inherited from class org.modama.framework.AbstractFrameworkModel
getName, setName
 
Methods inherited from class org.modama.Model
addPropertyChangeListener, addPropertyChangeListener, fire, fire, fire, getState, removePropertyChangeListener, removePropertyChangeListener, setState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

double[] data
the numbers

Constructor Detail

NumberList

public NumberList()

NumberList

public NumberList(java.lang.String initName)
Method Detail

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)