|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdata.DataHandler
public class DataHandler
A class to handle sets of input-output data.
| Field Summary | |
|---|---|
protected DataBlock |
lastBlock
|
| Constructor Summary | |
|---|---|
DataHandler()
Default constructor. |
|
| Method Summary | |
|---|---|
boolean |
add(DataPoint dataPoint)
Adds the given DataPoint to the set of data. |
void |
addBlock(DataBlock dataBlock)
Adds the given DataBlock to the set of data. |
void |
addListener(DataListener dataListener)
Adds the given DataListener to the list of listeners. |
void |
clear()
Clears all data. |
boolean |
contains(java.lang.Object o)
|
DataPoint |
get(int index)
Returns the DataPoint at the specified index in the data list. |
java.util.ArrayList<DataListener> |
getDataListeners()
Returns the list of DataListeners. |
int |
indexOf(java.lang.Object o)
Returns the index of the first DataPoint in the list that equals
the given object. |
boolean |
isEmpty()
Returns true if the data list is empty. |
java.util.Iterator<DataPoint> |
iterator()
Returns an iterator over the DataPoints in the data. |
DataPoint |
remove(int index)
Removes the DataPoint at the specified index. |
boolean |
remove(java.lang.Object o)
Removes all instances of the given Object from the list of
data. |
void |
removeLastBlock()
Removes the last block added. |
void |
removeListener(DataListener dataListener)
Removes the given DataListener from the list of listeners. |
void |
removeRange(int from,
int to)
Removes DataPoints with indices in the specified range. |
int |
size()
Returns the number of DataPoints in the collection of data. |
void |
writeToFile(java.io.PrintWriter writer)
Writes the contents of this DataHandler to the specified print writer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DataBlock lastBlock
| Constructor Detail |
|---|
public DataHandler()
| Method Detail |
|---|
public boolean add(DataPoint dataPoint)
DataPoint to the set of data. Notifies
DataListeners of the addition.
dataPoint - the given DataPoint.ArrayList.add(java.lang.Object)public void addBlock(DataBlock dataBlock)
DataBlock to the set of data.
dataBlock - the given DataBlock.public void addListener(DataListener dataListener)
dataListener - the given DataListener.public void clear()
DataListeners of the change.
ArrayList.clear()public boolean contains(java.lang.Object o)
ArrayList.contains(Object)public DataPoint get(int index)
DataPoint at the specified index in the data list.
ArrayList.get(int)public java.util.ArrayList<DataListener> getDataListeners()
DataListeners.
public int indexOf(java.lang.Object o)
DataPoint in the list that equals
the given object.
ArrayList.indexOf(Object)public boolean isEmpty()
true if the data list is empty.
ArrayList.isEmpty()public java.util.Iterator<DataPoint> iterator()
DataPoints in the data.
AbstractList.iterator()public DataPoint remove(int index)
DataPoint at the specified index. Notifies
DataListeners.
ArrayList.remove(int)public boolean remove(java.lang.Object o)
Object from the list of
data. This is in contrast to the definition in the Java Collections
Framework.
AbstractCollection.remove(Object)public void removeLastBlock()
public void removeListener(DataListener dataListener)
dataListener - the DataListener to remove.
public void removeRange(int from,
int to)
DataPoints with indices in the specified range. Note
removeRange(frmo, from) does nothing.
from - the index of the first element to be removed.to - the index after the last element to be removed.public int size()
DataPoints in the collection of data.
ArrayList.size()public void writeToFile(java.io.PrintWriter writer)
writer - the given PrintWriter.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||