|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.quattor.pan.dml.data.Element
org.quattor.pan.dml.data.PersistentElement
org.quattor.pan.dml.data.Resource
org.quattor.pan.dml.data.ListResource
public class ListResource
Represents an ordered list of elements.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.quattor.pan.dml.data.Resource |
|---|
Resource.Entry, Resource.Iterator |
| Constructor Summary | |
|---|---|
|
ListResource()
|
|
ListResource(Element[] args)
|
protected |
ListResource(ListResource source)
This method creates a shallow copy of the given ListResource. |
| Method Summary | |
|---|---|
void |
append(Element e)
Specialized method for a ListResource to append an element to the end of the list. |
void |
checkRange(Range range)
Determine if the element satisfies the given range constraint. |
void |
checkValidReplacement(Element newValue)
Check that the newValue is a valid replacement for the this value. |
Element |
duplicate()
This method does a "clone" of the given Element. |
boolean |
equals(java.lang.Object o)
Require that all Elements implement an equals method. |
Element |
get(Term term)
Retrieve the Element associated with the given Term (either an index or string key). |
protected java.util.List<Element> |
getBackingList()
This method is used to access the underlying map used to store the hash information. |
java.lang.String |
getTypeAsString()
All Elements must return a string describing its type. |
int |
hashCode()
Require that all Elements implement the hashCode method. |
Resource.Iterator |
iterator()
Get an iterator which allows to run over the resources in the Resource. |
java.lang.String |
locateUndefinedElement()
Determine if the element contains any undefined (transient) elements. |
void |
prepend(Element e)
Specialized method for a ListResource to prepend an element at the beginning of a list. |
Element |
protect()
Return a protected version of this Element. |
Element |
put(int index,
Element newValue)
This is an optimized version of the put method which doesn't require creating a Term object. |
Element |
put(Term term,
Element value)
Define the mapping between the given Term and given Element. |
int |
size()
Get the number of elements in this Resource. |
java.lang.String |
toString()
Require that all Elements implement a reasonable toString method. |
| Methods inherited from class org.quattor.pan.dml.data.Resource |
|---|
rget, rgetList, rput |
| Methods inherited from class org.quattor.pan.dml.data.Element |
|---|
checkInvalidSelfContext, checkRestrictedContext, defined, execute, exists, isBoolean, isDouble, isList, isLong, isNlist, isPersistent, isProperty, isProtected, isResource, isString, isTransient, writableCopy |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ListResource()
public ListResource(Element[] args)
protected ListResource(ListResource source)
source - ListResource to copy| Method Detail |
|---|
public Element duplicate()
Element
duplicate in class Element
public Element get(Term term)
throws InvalidTermException
Resource
get in class Resourceterm - Term which acts as the key for the desired Element
InvalidTermException - thrown if the term is not of the appropriate type for the
resource; the message should contain the string
representation of the term
public Element put(Term term,
Element value)
throws InvalidTermException
Resource
put in class Resourceterm - Term which acts as the key for the desired Elementvalue - Element to associate with the given Term
InvalidTermException - thrown if the term is not of the appropriate type for the
resource; the message should contain the string
representation of the term
public Element put(int index,
Element newValue)
index - index of the element to insertnewValue - value to insert into the list
public void append(Element e)
e - element to append to the end of the list; this may not be nullpublic void prepend(Element e)
e - element to prepend to beginning of list; this may not be nullpublic int size()
Resource
size in class Resourcepublic Resource.Iterator iterator()
Resource
iterator in interface java.lang.Iterable<Resource.Entry>iterator in class Resourcepublic java.lang.String locateUndefinedElement()
Element
locateUndefinedElement in class Element
public void checkRange(Range range)
throws ValidationException
Element
checkRange in class Elementrange - Range to check Element against
ValidationException - if the element cannot be compared to a range or if the
element doesn't meet the range requirement
public void checkValidReplacement(Element newValue)
throws EvaluationException
Element
checkValidReplacement in class ElementnewValue - the new value for the replacement
EvaluationException - if the new value is not a valid replacement of the existing
valuepublic Element protect()
Element
protect in class Elementpublic java.lang.String getTypeAsString()
Element
getTypeAsString in class Elementpublic int hashCode()
Element
hashCode in class Elementpublic boolean equals(java.lang.Object o)
Element
equals in class Elementprotected java.util.List<Element> getBackingList()
public java.lang.String toString()
Element
toString in class Element
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||