|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.util.IndirectCollection
com.davisor.util.IndirectList
com.davisor.data.TypeList
TypeList provides a tool to constuct type lists and hierarcies incrementally, one type and sub-type at a time. This functionality is usefull for example when type definitions are build from XML SAX events.
IntegerSequence,
TupleType| Nested Class Summary | |
protected static class |
TypeList.State
Tuple construction state. |
| Field Summary | |
protected java.util.Iterator |
M_idFactory
|
protected java.util.Set |
M_ids
Current set of type identities. |
protected java.util.Stack |
M_stack
Current state stack. |
protected TypeList.State |
M_state
Current state. |
| Fields inherited from class com.davisor.util.IndirectCollection |
M_collection |
| Constructor Summary | |
TypeList()
Default constructor. |
|
TypeList(java.util.Iterator idFactory)
Creates a new type list that uses given sequence to generate type identities. |
|
TypeList(java.util.List types)
Creates a new type list that collects types into given list instance. |
|
TypeList(java.util.List types,
java.util.Iterator idFactory)
Creates a new type list that collects types into given list and identity factory instances. |
|
| Method Summary | |
void |
add(int index,
java.lang.Object type)
Adds a type to a spesific place in currently open tuple type, or among to top-level types. |
boolean |
add(java.lang.Object type)
Adds a type to currently open tuple type, or among to top-level types. |
void |
add(Type type,
java.util.Set ids)
Adds given type identity to given identity set. |
boolean |
addAll(java.util.Collection collection)
Adds all element in an another collection into this collection. |
boolean |
addAll(int index,
java.util.Collection c)
Adds all element in an another collection into this collection. |
TupleType |
endTupleType()
Completes current tuple type. |
void |
startTupleType(java.lang.String dataName,
java.lang.String id,
java.lang.String metaName,
java.lang.String metaGroup)
Starts building a new tuple type. |
| Methods inherited from class com.davisor.util.IndirectList |
get, indexOf, lastIndexOf, listIterator, listIterator, remove, set, subList |
| Methods inherited from class com.davisor.util.IndirectCollection |
clear, contains, containsAll, getCollection, isEmpty, iterator, remove, removeAll, retainAll, setCollection, size, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Field Detail |
protected transient TypeList.State M_state
protected transient java.util.Stack M_stack
protected transient java.util.Set M_ids
protected java.util.Iterator M_idFactory
| Constructor Detail |
public TypeList()
public TypeList(java.util.Iterator idFactory)
idFactory - type identity generatorpublic TypeList(java.util.List types)
types - the list into which top-level types are to be collected
public TypeList(java.util.List types,
java.util.Iterator idFactory)
types - the list into which top-level types are to be collectedidFactory - type identity generator| Method Detail |
public boolean add(java.lang.Object type)
startTupleType(java.lang.String, java.lang.String, java.lang.String, java.lang.String) and endTupleType() method, the
type is added amont the current tuple type being
defined. Otherwise the type is added to the list of top-level
types.
The identity of the given type must be unique within the context the type is added in. In particular, if the type is a top-level type, no other top-level type must have equal identity. Likewise, if the type is a sub-level type, no other sub-level type in the current open tuple must have equal identity.
If the given type has no identity, a new identity is assigned to it using current identity factory. The newly generated identity must however still meet the identity uniqueness requiremenet. If it does not, the given type keeps it's new identity, but the type itself is rejected from this type list.
If the given type is added inside an open tuple type, type
METADATA_PARENT value is set to a string composed
from type parent and grantparent type identities.
type - type to be added (must be an instance of Type
true if this collection changed as a result
of the call
java.lang.IllegalArgumentException - if given type is invalidadd(Type,Set),
endTupleType(),
startTupleType(java.lang.String, java.lang.String, java.lang.String, java.lang.String)public boolean addAll(java.util.Collection collection)
true if this collection changed as a result
of the call
public void add(int index,
java.lang.Object type)
startTupleType(java.lang.String, java.lang.String, java.lang.String, java.lang.String) and endTupleType() method, the type is added amont the current tuple
type being defined. Otherwise the type is added to the list of
top-level types.
If the given type is added inside an open tuple type, type
METADATA_PARENT value is set to a string composed
from type parent and grantparent type identities.
index - the position to add the new typetype - type to be added (must be an instance of Type
java.lang.IllegalArgumentException - if type is not an instance of
TypeendTupleType(),
startTupleType(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public boolean addAll(int index,
java.util.Collection c)
true if this collection changed as a result
of the call
public void add(Type type,
java.util.Set ids)
If the given type has no identity, a new identity is assigned to it using current identity factory. The newly generated identity must however still meet the identity uniqueness requirement. If it does not, the given type keeps it's new identity, but the type itself is rejected.
type - type to addids - identity set
java.lang.IllegalArgumentException - if identity is not uniquepublic TupleType endTupleType()
java.lang.IllegalStateException - if no tuple is currently openadd(Object),
startTupleType(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void startTupleType(java.lang.String dataName,
java.lang.String id,
java.lang.String metaName,
java.lang.String metaGroup)
add(Object) and this method. In
particular, each call to this method recursviely opens a new
tuple type inside the previous one.
To eventually finish the type now opened and to get a reference
to it, call endTupleType(). To add types to the open
tuple, call add(Object). To add a TupleType inside
another, call this method again.
add(Object),
endTupleType()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||