public abstract class Property extends Object
Modifier | Constructor and Description |
---|---|
protected |
Property()
Constructor for subclasses.
|
Modifier and Type | Method and Description |
---|---|
static Property |
create(Object key,
Location location,
int flags)
Create a new property.
|
abstract Object |
get(DynamicObject store,
boolean condition)
Gets the value of this property of the object.
|
abstract Object |
get(DynamicObject store,
Shape shape)
Gets the value of this property of the object.
|
abstract int |
getFlags()
Get property flags, which are free for language-specific use.
|
abstract Object |
getKey()
Get property identifier.
|
abstract Location |
getLocation()
Get the property location.
|
abstract boolean |
isHidden()
Is this property hidden from iteration.
|
abstract void |
set(DynamicObject store,
Object value,
Shape shape)
Assigns value to this property of the object.
|
abstract void |
setGeneric(DynamicObject store,
Object value,
Shape shape)
Assigns value to this property of the object.
|
abstract void |
setSafe(DynamicObject store,
Object value,
Shape shape)
Like
Property.set(DynamicObject, Object, Shape) , but throws an IllegalStateException
instead. |
abstract void |
setSafe(DynamicObject store,
Object value,
Shape oldShape,
Shape newShape)
Assigns value to this property of the object, changing the object's shape.
|
public static Property create(Object key, Location location, int flags)
key
- the key of the propertylocation
- location of the propertyflags
- for language-specific usepublic abstract Object getKey()
public abstract int getFlags()
public abstract Object get(DynamicObject store, Shape shape)
store
- the store that this property resides inshape
- the current shape of the object, which must contain this locationDynamicObjectLibrary.getOrDefault(DynamicObject, Object, Object)
public abstract Object get(DynamicObject store, boolean condition)
store
- the store that this property resides incondition
- the result of a shape check or false
DynamicObjectLibrary.getOrDefault(DynamicObject, Object, Object)
,
Property.get(DynamicObject, Shape)
public abstract void set(DynamicObject store, Object value, Shape shape) throws IncompatibleLocationException, FinalLocationException
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 differDynamicObjectLibrary.put(DynamicObject, Object, Object)
public abstract void setGeneric(DynamicObject store, Object value, Shape shape)
shape
- the current shape of the object or null
public abstract void setSafe(DynamicObject store, Object value, Shape shape)
Property.set(DynamicObject, Object, Shape)
, but throws an IllegalStateException
instead.
Planned to be deprecated.public abstract void setSafe(DynamicObject store, Object value, Shape oldShape, Shape newShape)
setShapeAndGrow
and Property.setSafe(DynamicObject, Object, Shape)
to an
atomic operation.
Planned to be deprecated.store
- the store that this property resides invalue
- the value to assignoldShape
- the shape before the transitionnewShape
- the shape after the transitionpublic abstract Location getLocation()
public abstract boolean isHidden()
HiddenKey