public class ListResource extends Resource
isPropertyResource.Entry, Resource.Iterator| Modifier | Constructor and Description |
|---|---|
|
ListResource() |
|
ListResource(Element[] args) |
protected |
ListResource(ListResource source)
This method creates a shallow copy of the given ListResource.
|
| Modifier and Type | Method and Description |
|---|---|
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(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 List<Element> |
getBackingList()
This method is used to access the underlying map used to store the hash
information.
|
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.
|
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.
|
String |
toString()
Require that all Elements implement a reasonable toString method.
|
checkInvalidSelfContext, checkRestrictedContext, defined, execute, exists, isBoolean, isDouble, isList, isLong, isNlist, isPersistent, isProperty, isProtected, isResource, isString, isTransient, writableCopypublic ListResource()
public ListResource(Element[] args)
protected ListResource(ListResource source)
source - ListResource to copypublic Element duplicate()
Elementpublic Element get(Term term) throws InvalidTermException
Resourceget in class Resourceterm - Term which acts as the key for the desired ElementInvalidTermException - thrown if the term is not of the appropriate type for the
resource; the message should contain the string
representation of the termpublic Element put(Term term, Element value) throws InvalidTermException
Resourceput in class Resourceterm - Term which acts as the key for the desired Elementvalue - Element to associate with the given TermInvalidTermException - thrown if the term is not of the appropriate type for the
resource; the message should contain the string
representation of the termpublic Element put(int index, Element newValue)
index - index of the element to insertnewValue - value to insert into the listpublic 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()
Resourcepublic Resource.Iterator iterator()
Resourceiterator in interface Iterable<Resource.Entry>iterator in class Resourcepublic String locateUndefinedElement()
ElementlocateUndefinedElement in class Elementpublic void checkRange(Range range) throws ValidationException
ElementcheckRange in class Elementrange - Range to check Element againstValidationException - if the element cannot be compared to a range or if the
element doesn't meet the range requirementpublic void checkValidReplacement(Element newValue) throws EvaluationException
ElementcheckValidReplacement in class ElementnewValue - the new value for the replacementEvaluationException - if the new value is not a valid replacement of the existing
valuepublic Element protect()
Elementpublic String getTypeAsString()
ElementgetTypeAsString in class Elementpublic int hashCode()
Elementpublic boolean equals(Object o)
Elementprotected List<Element> getBackingList()
Copyright © 2014 Quattor. All Rights Reserved.