|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.quattor.pan.dml.data.Element
@Immutable public abstract class Element
Represents the most general data element in the Data Manipulation Language (DML). This class adds some utility methods which are useful for implementing some of the built-in functions.
| Constructor Summary | |
|---|---|
Element()
|
|
| Method Summary | |
|---|---|
void |
checkInvalidSelfContext()
The default implementation does nothing. |
void |
checkRange(Range range)
Determine if the element satisfies the given range constraint. |
void |
checkRestrictedContext()
The default implementation does nothing. |
void |
checkValidReplacement(Element newValue)
Check that the newValue is a valid replacement for the this value. |
boolean |
defined()
Determine if the given Element is defined. |
Element |
duplicate()
This method does a "clone" of the given Element. |
abstract boolean |
equals(java.lang.Object o)
Require that all Elements implement an equals method. |
Element |
execute(Context context)
All Elements are Operations and can be executed, but each just returns a reference to itself. |
boolean |
exists()
Returns true for all Element objects except Null. |
abstract java.lang.String |
getTypeAsString()
All Elements must return a string describing its type. |
abstract int |
hashCode()
Require that all Elements implement the hashCode method. |
boolean |
isBoolean()
Determine if the given Element is a Boolean. |
boolean |
isDouble()
Determine if the given Element is a Double. |
boolean |
isList()
Determine if the given Element is a List. |
boolean |
isLong()
Determine if the given Element is a Long. |
boolean |
isNlist()
Determine if the given Element is an Nlist. |
boolean |
isPersistent()
Determine if the given Element is Persistent. |
boolean |
isProperty()
Determine if the given Element is a Property. |
boolean |
isProtected()
This method indicates if the given Element is protected. |
boolean |
isResource()
Determine if the given Element is a Resource. |
boolean |
isString()
Determine if the given Element is a String. |
boolean |
isTransient()
Determine if the given Element is Transient. |
java.lang.String |
locateUndefinedElement()
Determine if the element contains any undefined (transient) elements. |
Element |
protect()
Return a protected version of this 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 java.lang.String |
toString()
Require that all Elements implement a reasonable toString method. |
Element |
writableCopy()
This method returns a writable copy of this Element. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Element()
| Method Detail |
|---|
public boolean exists()
public boolean defined()
public boolean isProperty()
public boolean isLong()
public boolean isDouble()
public boolean isBoolean()
public boolean isString()
public boolean isResource()
public boolean isNlist()
public boolean isList()
public boolean isPersistent()
public boolean isTransient()
public java.lang.String locateUndefinedElement()
public void checkRange(Range range)
throws ValidationException
range - 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 Element execute(Context context)
throws EvaluationException
execute in interface Operationcontext - evaluation context for the statement
EvaluationException - if an error occurs during processingpublic Element duplicate()
public Element writableCopy()
public void checkRestrictedContext()
throws SyntaxException
checkRestrictedContext in interface OperationSyntaxException - if this operation cannot be run within a restricted context
public void checkInvalidSelfContext()
throws SyntaxException
checkInvalidSelfContext in interface OperationSyntaxException - if this operation references SELFpublic boolean isProtected()
public void checkValidReplacement(Element newValue)
throws EvaluationException
newValue - the new value for the replacement
EvaluationException - if the new value is not a valid replacement of the existing
valuepublic Element protect()
public Element rget(Term[] terms,
int index,
boolean protect,
boolean lookupOnly)
throws InvalidTermException
terms - 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 exist
InvalidTermException - thrown if an trying to dereference a list with a key or a
hash with an index
public ListResource rgetList(Term[] terms,
int index)
throws InvalidTermException
terms - list of terms to use for dereferenceindex - the term to use in the given list of term
InvalidTermException
public void rput(Term[] terms,
int index,
Element value)
throws InvalidTermException
InvalidTermException - thrown if an trying to dereference a list with a key or a
hash with an indexpublic abstract java.lang.String getTypeAsString()
public abstract java.lang.String toString()
toString in class java.lang.Objectpublic abstract int hashCode()
hashCode in class java.lang.Objectpublic abstract boolean equals(java.lang.Object o)
equals in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||