public abstract class Location extends Object
Shape
,
Property
,
DynamicObject
Modifier | Constructor and Description |
---|---|
protected |
Location()
Constructor for subclasses.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canStore(Object value)
Returns
true if the location is compatible with the type of the value. |
abstract boolean |
equals(Object obj)
Abstract to force overriding.
|
Object |
getConstantValue()
If this is a constant location, returns the constant value bound to this location.
|
protected double |
getDouble(DynamicObject store,
boolean guard)
Gets this location's value as double.
|
Assumption |
getFinalAssumption()
Returns the assumption that this location is final.
|
protected int |
getInt(DynamicObject store,
boolean guard)
Gets this location's value as int.
|
protected long |
getLong(DynamicObject store,
boolean guard)
Gets this location's value as long.
|
abstract int |
hashCode()
Abstract to force overriding.
|
boolean |
isAssumedFinal()
Returns
true if this location is assumed to be final. |
boolean |
isConstant()
Returns
true if this is a constant value location. |
boolean |
isFinal()
Returns
true if this is a final location, i.e. |
boolean |
isPrimitive()
Returns
true if this location can only store primitive types and cannot contain any
object references. |
boolean |
isValue()
Returns
true if this is a value location. |
protected int getInt(DynamicObject store, boolean guard) throws UnexpectedResultException
store
- storage objectguard
- the result of a shape check or false
UnexpectedResultException
- if the location does not contain an int value.protected long getLong(DynamicObject store, boolean guard) throws UnexpectedResultException
store
- storage objectguard
- the result of a shape check or false
UnexpectedResultException
- if the location does not contain a long value.protected double getDouble(DynamicObject store, boolean guard) throws UnexpectedResultException
store
- storage objectguard
- the result of a shape check or false
UnexpectedResultException
- if the location does not contain a double value.public boolean canStore(Object value)
true
if the location is compatible with the type of the value.value
- the value in questionpublic boolean isFinal()
true
if this is a final location, i.e. readonly once set.public boolean isConstant()
true
if this is a constant value location.public abstract int hashCode()
public abstract boolean equals(Object obj)
public boolean isValue()
true
if this is a value location.Location.isConstant()
public boolean isAssumedFinal()
true
if this location is assumed to be final.Location.getFinalAssumption()
public Assumption getFinalAssumption()
Location.isAssumedFinal()
public boolean isPrimitive()
true
if this location can only store primitive types and cannot contain any
object references.public Object getConstantValue()