Package com.oracle.truffle.object

## Class PropertyImpl

- java.lang.Object
- - com.oracle.truffle.api.object.Property
  - - com.oracle.truffle.object.PropertyImpl

    public class PropertyImpl
    extends Property

Property objects represent the mapping between low-level stores and high-level data. The simplest Property could be nothing more than a map of one index to one property's value, but abstracting the interface allows for getter/setter methods, type-checked properties, and other such specialized and language-specific behavior. ECMAScript[8.6.1]

### Constructor Summary

Constructors
`` `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.

### Method Summary

All Methods Instance Methods Concrete Methods
`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()`

### Methods inherited from class com.oracle.truffle.api.object.Property

`create`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### PropertyImpl

    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.

Parameters:
  `key` - the name of the property

#### PropertyImpl

    public PropertyImpl​(java.lang.Object name,
                        Location location,
                        int flags)

### Method Detail

#### getKey

    public final java.lang.Object getKey()

Description copied from class: `Property`
Get property identifier.

Specified by:
  `getKey` in class `Property`

#### getFlags

    public int getFlags()

Description copied from class: `Property`
Get property flags.

Specified by:
  `getFlags` in class `Property`

#### relocate

    public Property relocate​(Location newLocation)

Description copied from class: `Property`
Change the property's location.

Specified by:
  `relocate` in class `Property`
Returns:
  a Property with the new location (or `this` if the location is unchanged).

#### get

    public final java.lang.Object get​(DynamicObject store,
                                      Shape shape)

Description copied from class: `Property`
Gets the value of this property of the object.

Specified by:
  `get` in class `Property`
Parameters:
  `store` - the store that this property resides in
  `shape` - the current shape of the object, which must contain this location
See Also:
  `DynamicObject.get(Object, Object)`

#### get

    public final java.lang.Object get​(DynamicObject store,
                                      boolean condition)

Description copied from class: `Property`
Gets the value of this property of the object.

Specified by:
  `get` in class `Property`
Parameters:
  `store` - the store that this property resides in
  `condition` - the result of a shape check or `false`
See Also:
  `DynamicObject.get(Object, Object)`, `Property.get(DynamicObject, Shape)`

#### setInternal

    public final void setInternal​(DynamicObject store,
                                  java.lang.Object value)

Description copied from class: `Property`
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. For internal use only.

Specified by:
  `setInternal` in class `Property`
Parameters:
  `store` - the store that this property resides in
  `value` - the value to assign

#### set

    public final void set​(DynamicObject store,
                          java.lang.Object value,
                          Shape shape)
                   throws IncompatibleLocationException,
                          FinalLocationException

Description copied from class: `Property`
Assigns value to this property of the object. Throws an exception if the value cannot be assigned to the property's current location.

Specified by:
  `set` in class `Property`
Parameters:
  `store` - the store that this property resides in
  `value` - the value to assign
  `shape` - the current shape of the object or `null`
Throws:
  `IncompatibleLocationException` - if the value is incompatible with the property location
  `FinalLocationException` - if the location is final and values differ
See Also:
  `DynamicObject.set(Object, Object)`

#### setSafe

    public final void setSafe​(DynamicObject store,
                              java.lang.Object value,
                              Shape shape)

Description copied from class: `Property`
Like `Property.set(DynamicObject, Object, Shape)`, but throws an `IllegalStateException` instead.

Specified by:
  `setSafe` in class `Property`

#### setGeneric

    public final void setGeneric​(DynamicObject store,
                                 java.lang.Object value,
                                 Shape shape)

Description copied from class: `Property`
Assigns value to this property of the object. Automatically relocates the property if the value cannot be assigned to its current location.

Specified by:
  `setGeneric` in class `Property`
  `shape` - the current shape of the object or `null`

#### set

    public final void set​(DynamicObject store,
                          java.lang.Object value,
                          Shape oldShape,
                          Shape newShape)
                   throws IncompatibleLocationException

Description copied from class: `Property`
Assigns value to this property of the object, changing the object's shape. Combines `DynamicObject.setShapeAndGrow(Shape, Shape)` and `Property.set(DynamicObject, Object, Shape)` to an atomic operation.

Specified by:
  `set` in class `Property`
Parameters:
  `store` - the store that this property resides in
  `value` - the value to assign
  `oldShape` - the shape before the transition
  `newShape` - the shape after the transition
Throws:
  `IncompatibleLocationException` - if the value is incompatible with the property location

#### setSafe

    public final void setSafe​(DynamicObject store,
                              java.lang.Object value,
                              Shape oldShape,
                              Shape newShape)

Description copied from class: `Property`
Assigns value to this property of the object, changing the object's shape. Combines `DynamicObject.setShapeAndGrow(Shape, Shape)` and `Property.setSafe(DynamicObject, Object, Shape)` to an atomic operation.

Specified by:
  `setSafe` in class `Property`
Parameters:
  `store` - the store that this property resides in
  `value` - the value to assign
  `oldShape` - the shape before the transition
  `newShape` - the shape after the transition

#### setGeneric

    public final void setGeneric​(DynamicObject store,
                                 java.lang.Object value,
                                 Shape oldShape,
                                 Shape newShape)

Description copied from class: `Property`
Assigns value to this property of the object, changing the object's shape. Combines `DynamicObject.setShapeAndGrow(Shape, Shape)` and `Property.setGeneric(DynamicObject, Object, Shape)` to an atomic operation.

Specified by:
  `setGeneric` in class `Property`
Parameters:
  `store` - the store that this property resides in
  `value` - the value to assign
  `oldShape` - the shape before the transition
  `newShape` - the shape after the transition

#### equals

    public boolean equals​(java.lang.Object obj)

Overrides:
  `equals` in class `java.lang.Object`

#### isSame

    public boolean isSame​(Property obj)

Description copied from class: `Property`
Returns `true` if this property and some other property have the same key and flags.

Specified by:
  `isSame` in class `Property`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `java.lang.Object`

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### getLocation

    public final Location getLocation()

Description copied from class: `Property`
Get the property location.

Specified by:
  `getLocation` in class `Property`

#### isHidden

    public final boolean isHidden()

Description copied from class: `Property`
Is this property hidden from iteration.

Specified by:
  `isHidden` in class `Property`
See Also:
  `HiddenKey`

#### isShadow

    public final boolean isShadow()

Specified by:
  `isShadow` in class `Property`

#### construct

    protected Property construct​(java.lang.Object name,
                                 Location location,
                                 int flags)

#### copyWithFlags

    public Property copyWithFlags​(int newFlags)

Description copied from class: `Property`
Create a copy of the property with the given flags.

Specified by:
  `copyWithFlags` in class `Property`

#### copyWithRelocatable

    public Property copyWithRelocatable​(boolean newRelocatable)

Specified by:
  `copyWithRelocatable` in class `Property`