public abstract class Resource extends PersistentElement implements Iterable<Resource.Entry>
isProperty| Modifier and Type | Class and Description |
|---|---|
static interface |
Resource.Entry
Interface is an alias to make the syntax for the Resource.Entry less
cumbersome.
|
static interface |
Resource.Iterator
Interface is simply an alias to make the syntax for the Resource.Iterator
less cumbersome.
|
| Constructor and Description |
|---|
Resource() |
| Modifier and Type | Method and Description |
|---|---|
abstract Element |
get(Term term)
Retrieve the Element associated with the given Term (either an index or
string key).
|
abstract Resource.Iterator |
iterator()
Get an iterator which allows to run over the resources in the Resource.
|
abstract Element |
put(Term term,
Element newValue)
Define the mapping between the given Term and given Element.
|
Element |
rget(Term[] terms,
int index,
boolean protect,
boolean lookupOnly)
Dereference the Element to return the value of a child.
|
ListResource |
rgetList(Term[] terms,
int index)
This is a special lookup function that will retrieve a list from the
resource.
|
void |
rput(Term[] terms,
int index,
Element value)
Add the given child to this resource, creating intermediate resources as
necessary.
|
abstract int |
size()
Get the number of elements in this Resource.
|
checkInvalidSelfContext, checkRange, checkRestrictedContext, checkValidReplacement, defined, duplicate, equals, execute, exists, getTypeAsString, hashCode, isBoolean, isDouble, isList, isLong, isNlist, isPersistent, isProperty, isProtected, isResource, isString, isTransient, locateUndefinedElement, protect, toString, writableCopypublic abstract Element get(Term term) throws InvalidTermException
term - 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 abstract Element put(Term term, Element newValue) throws InvalidTermException
term - Term which acts as the key for the desired ElementnewValue - 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 abstract int size()
public Element rget(Term[] terms, int index, boolean protect, boolean lookupOnly) throws InvalidTermException
Elementrget in class Elementterms - list of terms to use for dereferenceindex - the term to use in the given list of termprotect - flag to indicate that the return value should be a protected
(if value is a resource)lookupOnly - indicates that only a lookup is required, return null if the
element doesn't existInvalidTermException - thrown if an trying to dereference a list with a key or a
hash with an indexpublic void rput(Term[] terms, int index, Element value) throws InvalidTermException
Elementrput in class ElementInvalidTermException - thrown if an trying to dereference a list with a key or a
hash with an indexpublic ListResource rgetList(Term[] terms, int index) throws InvalidTermException
ElementrgetList in class Elementterms - list of terms to use for dereferenceindex - the term to use in the given list of termInvalidTermExceptionpublic abstract Resource.Iterator iterator()
iterator in interface Iterable<Resource.Entry>Copyright © 2014 Quattor. All Rights Reserved.