|
Data Request Broker 2-3-release |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<DrbItem>
fr.gael.drb.DrbDefaultSequence
public class DrbDefaultSequence
Generic implementation of DrbSequence. This default implementation extends an ArrayList provided by Java API. It is a generic mean to create a list of items. If no specific operations are required to implement the DrbSequence (e.g. filtering, caching, hashing, etc.). This class is a simple way to handle a collection of items. Note : the add() or equivalent operations of the ArrayList class have not been overrided to insure they insert DrbItem intances. Some inconsistency may appear * if no care is taken while calling add() or equivalent operations.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
|
DrbDefaultSequence()
Builds an empty sequence. |
protected |
DrbDefaultSequence(DrbDefaultSequence sequence)
Duplicate an existing sequence |
|
DrbDefaultSequence(DrbItem item)
Build a singleton from a item. |
|
DrbDefaultSequence(DrbSequence sequence)
Duplicate an existing sequence |
| Method Summary | |
|---|---|
DrbSequence |
addItem(DrbItem item)
Appends an item at the end of the item list. |
DrbSequence |
addItem(int index,
DrbItem item)
Inserts a item at a given position. |
ValueArray |
atomize()
The atomic values of this sequence. |
DrbItem |
getItem(int index)
Returns a specific item of the list. |
int |
getLength()
The number of items in the list. |
static void |
main(String[] args)
Make this class runnable for testing. |
DrbSequence |
removeItem(int index)
Removes an existing item. |
String |
toString()
Returns the string representation of this sequence |
| Methods inherited from class java.util.ArrayList |
|---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, removeAll, retainAll |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
| Constructor Detail |
|---|
public DrbDefaultSequence()
public DrbDefaultSequence(DrbItem item)
item - A reference to the singleton item.public DrbDefaultSequence(DrbSequence sequence)
sequence - A reference to the sequence to be duplicated.protected DrbDefaultSequence(DrbDefaultSequence sequence)
sequence - A reference to the sequence to be duplicated.| Method Detail |
|---|
public ValueArray atomize()
atomize in interface DrbSequencepublic final DrbItem getItem(int index)
getItem in interface DrbSequenceindex - The position of the item starting from 0 and not greater or
equal to the item count in the list.
public final int getLength()
getLength in interface DrbSequence
public DrbSequence addItem(int index,
DrbItem item)
throws NullPointerException,
UnsupportedOperationException,
IndexOutOfBoundsException
addItem in interface DrbSequenceindex - The expected index of the item after the insertion.item - A reference to the item to be inserted.
NullPointerException - This exception is raised when the passed item
a null reference. This exception may be overriden by an
UnsupportedOperationException.
IndexOutOfBoundsException - This exception is raised when the passe
index is less than zero or if it is greater or equal to the
number of item in the sequence prior the call
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested insertion for any
reason (e.g. impossible in this current specific case or in
general).
public DrbSequence addItem(DrbItem item)
throws NullPointerException,
UnsupportedOperationException
Important note: The implementation of the node is not supposed to accept any kind of node For instance it may not be possible to append a node wrapping a file in an XML document. The documentation of the implementation shall describe its specific strategy.
Case of unordered or specifically ordered implementations: If the implementation does not support ordered children or has specific ordering rules, the node may not be appended but only inserted according to these rules. For instance it may not be possible to impose the file order in a directory:it generally depends on the lexicographical order of the node names or their creation date.
item - A reference to the item to be appended.
NullPointerException - This exception is raised when the passed node
a null reference.This exception may be overriden by an
UnsupportedOperationException.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested append for any
reason (e.g. impossible in this current specific case or in
general).
public DrbSequence removeItem(int index)
throws IndexOutOfBoundsException,
UnsupportedOperationException
removeItem in interface DrbSequenceindex - Index of the item to be removed.
IndexOutOfBoundsException - This exception is raised when the passed
index is less than zero or greater or equal to the current
number of children.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested removal for any
reason.public String toString()
toString in class AbstractCollection<DrbItem>public static void main(String[] args)
args - the arguments.
|
Data Request Broker - DRB API® 2-3-release |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||