public abstract class LocationImpl extends Location
Modifier and Type | Class and Description |
---|---|
static interface |
LocationImpl.EffectivelyFinalLocation<T extends Location> |
static interface |
LocationImpl.InternalLongLocation |
static interface |
LocationImpl.TypedObjectLocation<T extends Location & ObjectLocation> |
Constructor and Description |
---|
LocationImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
canSet(DynamicObject store,
java.lang.Object value)
Returns
true if the location can be set to the value. |
boolean |
canStore(java.lang.Object value)
Returns
true if the location is compatible with the value. |
protected boolean |
canStoreFinal(DynamicObject store,
java.lang.Object value) |
boolean |
equals(java.lang.Object obj) |
protected java.lang.Object |
getInternal(DynamicObject store) |
protected java.lang.String |
getWhereString() |
int |
hashCode() |
boolean |
isConstant()
Returns
true if this is an immutable constant location. |
boolean |
isFinal()
Returns
true if this is a final location, i.e. |
int |
objectArrayCount()
Get the number of object array elements this location requires.
|
int |
objectFieldCount()
Get the number of in-object
Object fields this location requires. |
int |
primitiveArrayCount()
Get the number of primitive array elements this location requires.
|
int |
primitiveFieldCount()
Get the number of in-object primitive fields this location requires.
|
void |
set(DynamicObject store,
java.lang.Object value,
Shape shape)
Set object value at this location in store.
|
protected abstract void |
setInternal(DynamicObject store,
java.lang.Object value)
Like
Location.set(DynamicObject, Object, Shape) , but does not invalidate final locations. |
java.lang.String |
toString() |
static boolean |
valueEquals(java.lang.Object val1,
java.lang.Object val2)
Boxed values need to be compared by value not by reference.
|
checkShape, finalLocation, get, get, incompatibleLocation, set, set
public void set(DynamicObject store, java.lang.Object value, Shape shape) throws IncompatibleLocationException, FinalLocationException
BaseLocation
set
in interface BaseLocation
set
in class Location
shape
- the current shape of the storage objectIncompatibleLocationException
- for storage type invalidationsFinalLocationException
- for effectively final fieldsprotected final java.lang.Object getInternal(DynamicObject store)
getInternal
in class Location
protected abstract void setInternal(DynamicObject store, java.lang.Object value) throws IncompatibleLocationException
Location
Location.set(DynamicObject, Object, Shape)
, but does not invalidate final locations. For
internal use only and subject to change, use DynamicObjectFactory
to create objects
with predefined properties.setInternal
in class Location
IncompatibleLocationException
- if value is of non-assignable typepublic final boolean canSet(DynamicObject store, java.lang.Object value)
Location
true
if the location can be set to the value.public boolean canStore(java.lang.Object value)
Location
true
if the location is compatible with the value.
The value may still be rejected if Location.canSet(DynamicObject, Object)
returns false.protected boolean canStoreFinal(DynamicObject store, java.lang.Object value)
public boolean isFinal()
Location
true
if this is a final location, i.e. readonly once set.public boolean isConstant()
Location
true
if this is an immutable constant location.isConstant
in class Location
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String getWhereString()
public int objectArrayCount()
public int objectFieldCount()
Object
fields this location requires.public int primitiveFieldCount()
public int primitiveArrayCount()
public static boolean valueEquals(java.lang.Object val1, java.lang.Object val2)