|
SmartFrog 3.10.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.smartfrog.sfcore.reference.Reference
public class Reference
A reference is a list of ReferencePart objects. An example of a reference is: ATTRIB a-b, which would resolve to an attribute in one of the containing contexts called a, which has to be a component that contains an attribute named b. <br > WARNING: References are not safe for use in hashtables (and therefor as attribute keys) if they are modified, since the hashCode is based on the first element.
| Field Summary | |
|---|---|
protected boolean |
data
Indicator whether reference is data or link. |
protected boolean |
eager
Indicator whether reference is eager or lazy. |
static int |
inc
Capacity increment for references. |
static int |
initCap
Initial capacity for references. |
protected java.util.Vector |
ref
Actual reference. |
| Constructor Summary | |
|---|---|
Reference()
Constructs an empty reference. |
|
Reference(java.lang.Object referencePart)
Constructs a reference with a single reference part from a String. |
|
Reference(ReferencePart referencePart)
Constructs a reference with a single reference part. |
|
Reference(java.lang.String refString,
boolean parse)
Constructs a reference with a single reference part from a String or from a string in cannonical form using the parser. |
|
| Method Summary | |
|---|---|
ReferencePart |
addElement(ReferencePart o)
Adds element to the end of the reference. |
Reference |
addElements(Reference ref)
Adds a reference to the end of the reference. |
java.lang.Object |
clone()
Makes a clone of the reference. |
Reference |
clone(int start,
int len)
Clone this reference from start with length elements. |
java.lang.Object |
copy()
Returns a copy of the reference, by cloning itself and then copying all the reference parts. |
ReferencePart |
elementAt(int index)
Returns element at index. |
java.util.Enumeration |
elements()
Returns an enumeration over the elements of the reference. |
boolean |
equals(java.lang.Object ref)
Checks if this and given reference are equal. |
ReferencePart |
firstElement()
Returns first element of reference. |
static Reference |
fromString(java.lang.String refString)
Utility method to create a reference from a string. |
boolean |
getData()
Gets the data flag for the reference. |
boolean |
getEager()
Gets the eager flag for the reference. |
int |
hashCode()
Returns the hashcode for this reference. |
ReferencePart |
lastElement()
Returns last element in reference. |
boolean |
removeElement(ReferencePart o)
Remove element from reference. |
java.lang.Object |
resolve(ReferenceResolver rr,
int index)
Resolves this reference using the given reference resolver, and starting at index of this reference. |
java.lang.Object |
resolve(RemoteReferenceResolver rr,
int index)
Resolves this reference using the given remote reference resolver, and starting at index of this reference. |
boolean |
setData(boolean data)
Sets the data flag for the reference. |
boolean |
setEager(boolean eager)
Sets the eager flag for the reference. |
ReferencePart |
setElementAt(ReferencePart elem,
int index)
Sets the element at given index to a new element. |
int |
size()
Returns the size of the reference. |
java.lang.String |
toString()
Returns string representation of the reference. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static int initCap
Referencepublic static int inc
Referenceprotected java.util.Vector ref
protected boolean eager
protected boolean data
| Constructor Detail |
|---|
public Reference()
public Reference(java.lang.Object referencePart)
referencePart - part to be put in reference
public Reference(java.lang.String refString,
boolean parse)
throws SmartFrogResolutionException
refString - to be put/used in referenceparse - boolean to ask for string reference to be parsed or not
SmartFrogResolutionException - if reference is not validpublic Reference(ReferencePart referencePart)
referencePart - part to be put in reference| Method Detail |
|---|
public static Reference fromString(java.lang.String refString)
throws SmartFrogResolutionException
refString - string representing reference
SmartFrogResolutionException - if illegal reference in stringpublic java.lang.Object copy()
copy in interface CopyingCopyingpublic java.lang.Object clone()
clone in interface Copyingclone in class java.lang.Object
public Reference clone(int start,
int len)
start - index for copylen - length of copy
public boolean getEager()
setEager(boolean)public boolean setEager(boolean eager)
eager - new eager flag
getEager()public boolean getData()
setData(boolean)public boolean setData(boolean data)
data - new data flag
getData()public boolean equals(java.lang.Object ref)
equals in class java.lang.Objectref - to be compared
public int hashCode()
hashCode in class java.lang.Objectpublic java.util.Enumeration elements()
public int size()
public ReferencePart elementAt(int index)
index - to look up
public ReferencePart setElementAt(ReferencePart elem,
int index)
elem - element to set toindex - index to set at
public ReferencePart lastElement()
public ReferencePart firstElement()
public ReferencePart addElement(ReferencePart o)
o - reference part to add
public Reference addElements(Reference ref)
ref - of elements to be added
public boolean removeElement(ReferencePart o)
o - to remove from reference
public java.lang.Object resolve(ReferenceResolver rr,
int index)
throws SmartFrogResolutionException
rr - ReferenceResolver to be used for resolving this referenceindex - index of first referencepart to start resolving at
SmartFrogResolutionException - reference failed to resolve
public java.lang.Object resolve(RemoteReferenceResolver rr,
int index)
throws SmartFrogResolutionException
rr - ReferenceResolver to be used for resolving this referenceindex - index of first referencepart to start resolving at
SmartFrogResolutionException - if reference failed to resolvepublic java.lang.String toString()
toString in class java.lang.Object
|
SmartFrog CORE 3.10.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||