Interface DynamicObject

All Superinterfaces:
TypedObject
All Known Implementing Classes:
DynamicObjectBasic, DynamicObjectImpl

public interface DynamicObject extends TypedObject
  • Method Details

    • getShape

      Shape getShape()
      Get the object's current shape.
    • get

      Object get(Object key, Object defaultValue)
      Get property value.
      Parameters:
      key - property identifier
      defaultValue - return value if property is not found
      Returns:
      property value or defaultValue if object has no such property
    • set

      boolean set(Object key, Object value)
      Set value of existing property.
      Parameters:
      key - property identifier
      value - value to be set
      Returns:
      true if successful or false if property not found
    • define

      void define(Object key, Object value, int flags)
      Define new property or redefine existing property.
      Parameters:
      key - property identifier
      value - value to be set
      flags - flags to be set
    • define

      void define(Object key, Object value, int flags, LocationFactory locationFactory)
      Define new property with a static location or change existing property.
      Parameters:
      key - property identifier
      value - value to be set
      flags - flags to be set
      locationFactory - factory function that creates a location for a given shape and value
    • changeFlags

      boolean changeFlags(Object key, int newFlags)
      Change property flags.
      Parameters:
      key - property identifier
      newFlags - flags to be set
      Returns:
      true if successful or false if property not found
    • changeFlags

      boolean changeFlags(Object key, DynamicObject.FlagsFunction flagsUpdateFunction)
      Change property flags.
      Parameters:
      key - property identifier
      flagsUpdateFunction - function updating old flags to new flags
      Returns:
      true if successful or false if property not found
    • delete

      boolean delete(Object key)
      Delete property.
      Parameters:
      key - property identifier
      Returns:
      true if successful or false if property not found
    • size

      int size()
      Returns the number of properties in this object.
    • isEmpty

      boolean isEmpty()
      Returns true if this object contains no properties.
    • setShapeAndGrow

      void setShapeAndGrow(Shape oldShape, Shape newShape)
      Set object shape and grow storage if necessary.
      Parameters:
      oldShape - the object's current shape (must equal getShape())
      newShape - the new shape to be set
    • setShapeAndResize

      void setShapeAndResize(Shape oldShape, Shape newShape)
      Set object shape and resize storage if necessary.
      Parameters:
      oldShape - the object's current shape (must equal getShape())
      newShape - the new shape to be set
    • updateShape

      boolean updateShape()
      Ensure object shape is up-to-date.
      Returns:
      true if shape has changed