public interface DynamicObject extends TypedObject
Modifier and Type | Interface and Description |
---|---|
static interface |
DynamicObject.FlagsFunction |
Modifier and Type | Method and Description |
---|---|
boolean |
changeFlags(java.lang.Object key,
DynamicObject.FlagsFunction flagsUpdateFunction)
Change property flags.
|
boolean |
changeFlags(java.lang.Object key,
int newFlags)
Change property flags.
|
void |
define(java.lang.Object key,
java.lang.Object value,
int flags)
Define new property or redefine existing property.
|
void |
define(java.lang.Object key,
java.lang.Object value,
int flags,
LocationFactory locationFactory)
Define new property with a static location or change existing property.
|
boolean |
delete(java.lang.Object key)
Delete property.
|
java.lang.Object |
get(java.lang.Object key,
java.lang.Object defaultValue)
Get property value.
|
Shape |
getShape()
Get the object's current shape.
|
boolean |
isEmpty()
Returns
true if this object contains no properties. |
boolean |
set(java.lang.Object key,
java.lang.Object value)
Set value of existing property.
|
void |
setShapeAndGrow(Shape oldShape,
Shape newShape)
Set object shape and grow storage if necessary.
|
void |
setShapeAndResize(Shape oldShape,
Shape newShape)
Set object shape and resize storage if necessary.
|
int |
size()
Returns the number of properties in this object.
|
boolean |
updateShape()
Ensure object shape is up-to-date.
|
getTypeIdentifier
Shape getShape()
java.lang.Object get(java.lang.Object key, java.lang.Object defaultValue)
key
- property identifierdefaultValue
- return value if property is not foundboolean set(java.lang.Object key, java.lang.Object value)
key
- property identifiervalue
- value to be settrue
if successful or false
if property not foundvoid define(java.lang.Object key, java.lang.Object value, int flags)
key
- property identifiervalue
- value to be setflags
- flags to be setvoid define(java.lang.Object key, java.lang.Object value, int flags, LocationFactory locationFactory)
key
- property identifiervalue
- value to be setflags
- flags to be setlocationFactory
- factory function that creates a location for a given shape and valueboolean changeFlags(java.lang.Object key, int newFlags)
key
- property identifiernewFlags
- flags to be settrue
if successful or false
if property not foundboolean changeFlags(java.lang.Object key, DynamicObject.FlagsFunction flagsUpdateFunction)
key
- property identifierflagsUpdateFunction
- function updating old flags to new flagstrue
if successful or false
if property not foundboolean delete(java.lang.Object key)
key
- property identifiertrue
if successful or false
if property not foundint size()
boolean isEmpty()
true
if this object contains no properties.void setShapeAndGrow(Shape oldShape, Shape newShape)
oldShape
- the object's current shape (must equal getShape()
)newShape
- the new shape to be setvoid setShapeAndResize(Shape oldShape, Shape newShape)
oldShape
- the object's current shape (must equal getShape()
)newShape
- the new shape to be setboolean updateShape()
true
if shape has changed