com.aptana.ide.editor.js.runtime
Class Reference

java.lang.Object
  extended by com.aptana.ide.editor.js.runtime.Reference
Direct Known Subclasses:
JSReference

public class Reference
extends java.lang.Object

Author:
Kevin Lindsey

Field Summary
static Reference Empty
          The empty reference
 
Constructor Summary
Reference(IObject objectBase, java.lang.String propertyName)
          Create a new instance of Reference
 
Method Summary
 IObject getObjectBase()
          Get the base object where this referenced property lives
 Property getProperty()
          Retrieve the property that this references points to
 java.lang.String getPropertyName()
          Get the name of the property this reference refers to
 IObject getValue(int fileIndex, int offset)
          Get the value pointed to by this reference
 void setValue(IObject value, int fileIndex)
          Set the value of this reference
 void unsetValue(IObject value, int fileIndex)
          Unset the property this reference points to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Empty

public static final Reference Empty
The empty reference

Constructor Detail

Reference

public Reference(IObject objectBase,
                 java.lang.String propertyName)
Create a new instance of Reference

Parameters:
objectBase - The base object for this reference
propertyName - The base object property name this reference refers to
Method Detail

getObjectBase

public IObject getObjectBase()
Get the base object where this referenced property lives

Returns:
The base object of this reference

getPropertyName

public java.lang.String getPropertyName()
Get the name of the property this reference refers to

Returns:
The property name of this reference

getProperty

public Property getProperty()
Retrieve the property that this references points to

Returns:
The property this reference points to

getValue

public IObject getValue(int fileIndex,
                        int offset)
Get the value pointed to by this reference

Parameters:
fileIndex - The index of the file where this reference points
offset - The offset within the file
Returns:
Returns the IObject that this reference points to

setValue

public void setValue(IObject value,
                     int fileIndex)
Set the value of this reference

Parameters:
value - The new value for this reference
fileIndex - The index of the file where this reference points

unsetValue

public void unsetValue(IObject value,
                       int fileIndex)
Unset the property this reference points to. This will only remove the associated property if the reference count of that property goes to zero

Parameters:
value - The value to unset
fileIndex - The index of the file where this reference points