public abstract class Shape extends Object
DynamicObject,
Property,
Location| Modifier and Type | Class and Description |
|---|---|
static class |
Shape.Allocator
Utility class to allocate locations in an object layout.
|
static interface |
Shape.Pred<T>
Represents a predicate (boolean-valued function) of one argument.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Shape()
Constructor for subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Shape |
addProperty(Property property)
Add a new property in the map, yielding a new or cached Shape object.
|
abstract Shape.Allocator |
allocator()
Obtain an
Shape.Allocator instance for the purpose of allocating locations. |
abstract Shape |
append(Property oldProperty)
Append the property, relocating it to the next allocated location.
|
abstract Shape |
changeType(ObjectType newOps)
Change the shape's type, yielding a new shape.
|
abstract boolean |
check(DynamicObject subject)
Check whether this shape is identical to the given shape.
|
abstract DynamicObjectFactory |
createFactory()
Create a
DynamicObjectFactory for creating instances of this shape. |
abstract Shape |
createSeparateShape(Object sharedData)
Clone off a separate shape with new shared data.
|
abstract Shape |
defineProperty(Object key,
Object value,
int flags)
Add or change property in the map, yielding a new or cached Shape object.
|
abstract Shape |
defineProperty(Object key,
Object value,
int flags,
LocationFactory locationFactory)
Add or change property in the map, yielding a new or cached Shape object.
|
abstract int |
getId() |
abstract List<Object> |
getKeyList()
Get a list of all property keys in insertion order.
|
abstract List<Object> |
getKeyList(Shape.Pred<Property> filter)
Get a filtered list of property keys in insertion order.
|
abstract Iterable<Object> |
getKeys()
Get all property keys in insertion order.
|
abstract Property |
getLastProperty()
Get the last added property.
|
abstract Layout |
getLayout()
Get the shape's layout.
|
abstract Assumption |
getLeafAssumption()
Get an assumption that the shape is a leaf.
|
abstract Object |
getMutex()
Get mutex object shared by related shapes, i.e.
|
abstract ObjectType |
getObjectType()
Get the shape's operations.
|
abstract Shape |
getParent() |
abstract Iterable<Property> |
getProperties()
An
Iterable over the shape's properties in insertion order. |
abstract Property |
getProperty(Object key)
Get a property entry by key.
|
abstract int |
getPropertyCount()
Get number of properties in this shape.
|
abstract List<Property> |
getPropertyList()
Get a list of all properties that this Shape stores.
|
abstract List<Property> |
getPropertyList(Shape.Pred<Property> filter)
Get a list of properties that this Shape stores.
|
abstract List<Property> |
getPropertyListInternal(boolean ascending)
Returns all (also hidden) property objects in this shape.
|
abstract Shape |
getRoot()
Get the root shape.
|
abstract Object |
getSharedData()
Get the shape's shared data.
|
abstract Assumption |
getValidAssumption()
Get an assumption that the shape is valid.
|
abstract boolean |
hasProperty(Object key)
Check whether the shape has a property with the given key.
|
abstract boolean |
hasTransitionWithKey(Object key)
Query whether the shape has a transition with the given key.
|
abstract boolean |
isLeaf()
Check whether this shape is a leaf in the transition graph, i.e.
|
abstract boolean |
isRelated(Shape other)
Are these two shapes related, i.e.
|
boolean |
isShared()
Whether this shape is
shared. |
abstract boolean |
isValid()
Check whether this shape is valid.
|
Shape |
makeSharedShape()
Make a shared variant of this shape, to allow safe usage of this object between threads.
|
abstract DynamicObject |
newInstance()
Create a new
DynamicObject instance with this shape. |
abstract Shape |
removeProperty(Property property)
Remove the given property from the shape.
|
abstract Shape |
replaceProperty(Property oldProperty,
Property newProperty)
Replace a property in the shape.
|
abstract Shape |
reservePrimitiveExtensionArray()
Reserve the primitive extension array field.
|
abstract Shape |
tryMerge(Shape other)
Try to merge two related shapes to a more general shape that has the same properties and can
store at least the values of both shapes.
|
public abstract Property getProperty(Object key)
key - the identifier to look uppublic abstract Shape addProperty(Property property)
property - the property to addpublic abstract Shape defineProperty(Object key, Object value, int flags)
public abstract Shape defineProperty(Object key, Object value, int flags, LocationFactory locationFactory)
public abstract Iterable<Property> getProperties()
Iterable over the shape's properties in insertion order.public abstract List<Property> getPropertyList(Shape.Pred<Property> filter)
public abstract List<Property> getPropertyList()
public abstract List<Property> getPropertyListInternal(boolean ascending)
ascending - desired order (true for insertion order, false for reverse
insertion order)public abstract List<Object> getKeyList(Shape.Pred<Property> filter)
public abstract List<Object> getKeyList()
public abstract Iterable<Object> getKeys()
public abstract Assumption getValidAssumption()
public abstract boolean isValid()
public abstract Assumption getLeafAssumption()
public abstract boolean isLeaf()
public abstract Shape getParent()
null if none.public abstract boolean hasProperty(Object key)
public abstract Shape removeProperty(Property property)
public abstract Shape replaceProperty(Property oldProperty, Property newProperty)
public abstract Property getLastProperty()
public abstract int getId()
public abstract Shape append(Property oldProperty)
public abstract Shape.Allocator allocator()
Shape.Allocator instance for the purpose of allocating locations.public abstract int getPropertyCount()
public abstract ObjectType getObjectType()
public abstract Shape getRoot()
public abstract boolean check(DynamicObject subject)
public abstract Layout getLayout()
public abstract Object getSharedData()
public abstract boolean hasTransitionWithKey(Object key)
public abstract Shape createSeparateShape(Object sharedData)
public abstract Shape changeType(ObjectType newOps)
public abstract Shape reservePrimitiveExtensionArray()
public abstract DynamicObject newInstance()
DynamicObject instance with this shape.public abstract DynamicObjectFactory createFactory()
DynamicObjectFactory for creating instances of this shape.public abstract Object getMutex()
public abstract boolean isRelated(Shape other)
other - Shape to compare topublic abstract Shape tryMerge(Shape other)
public boolean isShared()
shared.public Shape makeSharedShape()