|
||||||||||
| 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.HashResource
public class HashResource
Represents an nlist or hash that associates a string value (key) to another element. The key must be a string the is a valid term in a pan path.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.quattor.pan.dml.data.Resource |
|---|
Resource.Entry, Resource.Iterator |
| Constructor Summary | |
|---|---|
|
HashResource()
|
protected |
HashResource(HashResource source)
This constructor creates a shallow copy of the given HashResource. |
| Method Summary | |
|---|---|
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.Map<java.lang.String,Element> |
getBackingMap()
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.util.Set<Term> |
keySet()
|
java.lang.String |
locateUndefinedElement()
Determine if the element contains any undefined (transient) elements. |
Element |
protect()
Return a protected version of this Element. |
Element |
put(Term term,
Element newValue)
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 HashResource()
protected HashResource(HashResource source)
source - HashResource 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 newValue)
throws InvalidTermException
Resource
put in class Resourceterm - Term which acts as the key for the desired ElementnewValue - 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 termpublic int size()
Resource
size in class Resourcepublic java.util.Set<Term> keySet()
public 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.Map<java.lang.String,Element> getBackingMap()
public java.lang.String toString()
Element
toString in class Elementpublic Resource.Iterator iterator()
Resource
iterator in interface java.lang.Iterable<Resource.Entry>iterator in class Resource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||