edu.ucsb.cs.jicos.services.external
Class ExternalDataList

java.lang.Object
  extended by java.util.AbstractCollection
      extended by java.util.AbstractList
          extended by java.util.AbstractSequentialList
              extended by java.util.LinkedList
                  extended by edu.ucsb.cs.jicos.services.external.ExternalDataList
All Implemented Interfaces:
ExternalData, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.Queue

public class ExternalDataList
extends java.util.LinkedList
implements ExternalData

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ExternalDataList()
          Creates a new empty List.
ExternalDataList(java.util.Collection collection)
          Creates a new List and populates it with the contents of collection.
 
Method Summary
 boolean add(java.lang.String key, java.lang.String value)
          Add an individual value to the list.
 boolean addKeyValuePairs(java.lang.String[][] keyValuePair)
          Helper method - add an array of key value pairs.
 java.lang.String[] getArray(java.lang.String xpathQuery)
          Get an array of values in the form of org.w3c.dom.Element[].
 java.lang.String getValue(java.lang.String keyName)
          Get an individual value from the list.
 ExternalData removeWrapper()
          Get the data out of the (optional) wrapper.
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, peek, poll, remove, remove, remove, removeFirst, removeLast, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

ExternalDataList

public ExternalDataList()
Creates a new empty List.


ExternalDataList

public ExternalDataList(java.util.Collection collection)
Creates a new List and populates it with the contents of collection.

Parameters:
collection - An existing collection to add to the list.
Method Detail

getArray

public java.lang.String[] getArray(java.lang.String xpathQuery)
Get an array of values in the form of org.w3c.dom.Element[].
SOME Known Limitations:

Specified by:
getArray in interface ExternalData
Parameters:
xpathQuery - An XPath query.
Returns:
An individual node.

getValue

public java.lang.String getValue(java.lang.String keyName)
Get an individual value from the list. This performs a regex match and returns the first matching key in the list. SOME Known Limitations:
Selections:

Specified by:
getValue in interface ExternalData
Parameters:
keyName - A (fake) XPath query.
Returns:
An individual string value.

removeWrapper

public ExternalData removeWrapper()
Get the data out of the (optional) wrapper. This may return the same object.

Specified by:
removeWrapper in interface ExternalData
Returns:
The list.

add

public boolean add(java.lang.String key,
                   java.lang.String value)
Add an individual value to the list.

Parameters:
key - The key of this pair.
value - An String associated with this key.

addKeyValuePairs

public boolean addKeyValuePairs(java.lang.String[][] keyValuePair)
Helper method - add an array of key value pairs.

Parameters:
keyValuePair - An array of key/value pairs.


Jicos: http://cs.ucsb.edu/projects/jicos