public class PropertyImpl extends Property
Modifier | Constructor and Description |
---|---|
|
PropertyImpl(java.lang.Object name,
Location location,
int flags) |
protected |
PropertyImpl(java.lang.Object key,
Location location,
int flags,
boolean shadow,
boolean relocatable)
Generic, usual-case constructor for properties storing at least a name.
|
Modifier and Type | Method and Description |
---|---|
protected Property |
construct(java.lang.Object name,
Location location,
int flags) |
Property |
copyWithFlags(int newFlags)
Create a copy of the property with the given flags.
|
Property |
copyWithRelocatable(boolean newRelocatable) |
boolean |
equals(java.lang.Object obj) |
java.lang.Object |
get(DynamicObject store,
boolean condition)
Gets the value of this property of the object.
|
java.lang.Object |
get(DynamicObject store,
Shape shape)
Gets the value of this property of the object.
|
int |
getFlags()
Get property flags.
|
java.lang.Object |
getKey()
Get property identifier.
|
Location |
getLocation()
Get the property location.
|
int |
hashCode() |
boolean |
isHidden()
Is this property hidden from iteration.
|
boolean |
isSame(Property obj)
Returns
true if this property and some other property have the same key and flags. |
boolean |
isShadow() |
Property |
relocate(Location newLocation)
Change the property's location.
|
void |
set(DynamicObject store,
java.lang.Object value,
Shape shape)
Assigns value to this property of the object.
|
void |
set(DynamicObject store,
java.lang.Object value,
Shape oldShape,
Shape newShape)
Assigns value to this property of the object, changing the object's shape.
|
void |
setGeneric(DynamicObject store,
java.lang.Object value,
Shape shape)
Assigns value to this property of the object.
|
void |
setGeneric(DynamicObject store,
java.lang.Object value,
Shape oldShape,
Shape newShape)
Assigns value to this property of the object, changing the object's shape.
|
void |
setInternal(DynamicObject store,
java.lang.Object value)
Like
Property.setSafe(com.oracle.truffle.api.object.DynamicObject, java.lang.Object, com.oracle.truffle.api.object.Shape) , but ignores the finalness of the property. |
void |
setSafe(DynamicObject store,
java.lang.Object value,
Shape shape)
Like
Property.set(DynamicObject, Object, Shape) , but throws an IllegalStateException
instead. |
void |
setSafe(DynamicObject store,
java.lang.Object value,
Shape oldShape,
Shape newShape)
Assigns value to this property of the object, changing the object's shape.
|
java.lang.String |
toString() |
protected PropertyImpl(java.lang.Object key, Location location, int flags, boolean shadow, boolean relocatable)
key
- the name of the propertypublic PropertyImpl(java.lang.Object name, Location location, int flags)
public final java.lang.Object getKey()
Property
public int getFlags()
Property
public Property relocate(Location newLocation)
Property
public final java.lang.Object get(DynamicObject store, Shape shape)
Property
get
in class Property
store
- the store that this property resides inshape
- the current shape of the object, which must contain this locationDynamicObject.get(Object, Object)
public final java.lang.Object get(DynamicObject store, boolean condition)
Property
get
in class Property
store
- the store that this property resides incondition
- the result of a shape check or false
DynamicObject.get(Object, Object)
,
Property.get(DynamicObject, Shape)
public final void setInternal(DynamicObject store, java.lang.Object value)
Property
Property.setSafe(com.oracle.truffle.api.object.DynamicObject, java.lang.Object, com.oracle.truffle.api.object.Shape)
, but ignores the finalness of the property. For internal use only.setInternal
in class Property
store
- the store that this property resides invalue
- the value to assignpublic final void set(DynamicObject store, java.lang.Object value, Shape shape) throws IncompatibleLocationException, FinalLocationException
Property
set
in class Property
store
- the store that this property resides invalue
- the value to assignshape
- the current shape of the object or null
IncompatibleLocationException
- if the value is incompatible with the property locationFinalLocationException
- if the location is final and values differDynamicObject.set(Object, Object)
public final void setSafe(DynamicObject store, java.lang.Object value, Shape shape)
Property
Property.set(DynamicObject, Object, Shape)
, but throws an IllegalStateException
instead.public final void setGeneric(DynamicObject store, java.lang.Object value, Shape shape)
Property
setGeneric
in class Property
shape
- the current shape of the object or null
public final void set(DynamicObject store, java.lang.Object value, Shape oldShape, Shape newShape) throws IncompatibleLocationException
Property
DynamicObject.setShapeAndGrow(Shape, Shape)
and
Property.set(DynamicObject, Object, Shape)
to an atomic operation.set
in class Property
store
- the store that this property resides invalue
- the value to assignoldShape
- the shape before the transitionnewShape
- the shape after the transitionIncompatibleLocationException
- if the value is incompatible with the property locationpublic final void setSafe(DynamicObject store, java.lang.Object value, Shape oldShape, Shape newShape)
Property
DynamicObject.setShapeAndGrow(Shape, Shape)
and
Property.setSafe(DynamicObject, Object, Shape)
to an atomic operation.public final void setGeneric(DynamicObject store, java.lang.Object value, Shape oldShape, Shape newShape)
Property
DynamicObject.setShapeAndGrow(Shape, Shape)
and
Property.setGeneric(DynamicObject, Object, Shape)
to an atomic operation.setGeneric
in class Property
store
- the store that this property resides invalue
- the value to assignoldShape
- the shape before the transitionnewShape
- the shape after the transitionpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean isSame(Property obj)
Property
true
if this property and some other property have the same key and flags.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public final Location getLocation()
Property
getLocation
in class Property
public final boolean isHidden()
Property
public Property copyWithFlags(int newFlags)
Property
copyWithFlags
in class Property
public Property copyWithRelocatable(boolean newRelocatable)
copyWithRelocatable
in class Property