|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjeters.core.NamedDataSet
public class NamedDataSet
Storage for objects of any type. Individual objects can be accessed using String identifiers.
Nested Class Summary | |
---|---|
static class |
NamedDataSet.NamedElement
a value together with a String identifier |
Constructor Summary | |
---|---|
NamedDataSet()
creates an empty NamedDataSet |
|
NamedDataSet(java.lang.String[] nameArray,
java.lang.Object[] dataArray)
creates a NamedDataSet with one element, same effect as using(NamedDataSet) and then calling add(nameArray,dataArray) |
|
NamedDataSet(java.lang.String name,
java.lang.Object data)
creates a NamedDataSet with one element, same effect as using(NamedDataSet) and then calling add(name,data) |
Method Summary | ||
---|---|---|
void |
add(java.lang.String[] nameArray,
java.lang.Object[] dataArray)
add an array of objects to the list |
|
void |
add(java.lang.String name,
java.lang.Object data)
add one object to the list |
|
void |
clear()
empties the NamedDataSet |
|
|
get(java.lang.String name)
returns an element of the list identified by a given String casted to type parameter T |
|
java.util.Iterator<NamedDataSet.NamedElement> |
iterator()
|
|
void |
remove(java.lang.String name)
removes all objects identified by the given name from the NamedDataSet |
|
int |
size()
returns the number of elements of this NamedDataSet |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NamedDataSet()
public NamedDataSet(java.lang.String name, java.lang.Object data)
name
- String identifier. Use unique strings for each Object added to the same instance of NamedDataSet!data
- the object to be added to the NamedDataSetpublic NamedDataSet(java.lang.String[] nameArray, java.lang.Object[] dataArray)
nameArray
- array of String identifiers (nameArray[i] is identifier for dataArray[i]). The length of nameArray must equal the length of dataArray. Use unique strings for each Object added to the same instance of NamedDataSet!dataArray
- array of objects to be added to the NamedDataSet. The length of nameArray must equal the length of dataArray.Method Detail |
---|
public java.util.Iterator<NamedDataSet.NamedElement> iterator()
iterator
in interface java.lang.Iterable<NamedDataSet.NamedElement>
public <T> T get(java.lang.String name) throws NamedDataNotAvailableException
name
- the String identifier of the requested object
NamedDataNotAvailableException
public void add(java.lang.String name, java.lang.Object data)
name
- String identifier, not null. Use unique strings for each Object added to the same instance of NamedDataSet!data
- the object to be added to the NamedDataSetpublic void add(java.lang.String[] nameArray, java.lang.Object[] dataArray)
nameArray
- array of String identifiers (nameArray[i] is identifier for dataArray[i]), not null, no element null. The length of nameArray must equal the length of dataArray. Use unique strings for each Object added to the same instance of NamedDataSet!dataArray
- array of objects to be added to the NamedDataSet, not null, no element null. The length of nameArray must equal the length of dataArray.public void remove(java.lang.String name)
name
- objects whose String identifier equals name will be removedpublic void clear()
public int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |