|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.multi.communication.worldview.property.AbstractSharedProperty<TYPE>
public abstract class AbstractSharedProperty<TYPE>
Abstract implementation of the ISharedProperty object, this class manages the methods every ISharedProperty needs to have, regardless of its type.
SharedProperties are generally derived from bot's subjective observation of the world (local properties). If the local properties, which are used to derive the value of the sharedProperty are dated, the sharedProperty is considered "dirty", because the value might be wrong, the team that owns this property only assumes the value.
Nested Class Summary | |
---|---|
static class |
AbstractSharedProperty.GenericPropertyUpdate
|
Field Summary | |
---|---|
protected Class<?> |
compositeClass
|
protected boolean |
dirty
|
protected PropertyId |
propertyId
|
protected TYPE |
value
|
Constructor Summary | |
---|---|
AbstractSharedProperty(AbstractSharedProperty source)
Used in copy-constructors, when writing a copy constructor for a descendant class, you must add a clone for value. |
|
AbstractSharedProperty(WorldObjectId objectId,
String identifier,
Class compositeClass)
Used in propertyConstructors from data. |
|
AbstractSharedProperty(WorldObjectId objId,
String identifier,
TYPE value,
Class<?> compositeClass)
|
Method Summary | |
---|---|
abstract ISharedProperty<TYPE> |
clone()
Must return an exact duplicate of this ISharedProperty, this will be used to create old versions of SharedProperties in the worldView. |
protected abstract TYPE |
cloneValue()
Every descendant must implement this by calling value.clone() or otherwise returning a new copy of value. |
ISharedPropertyUpdatedEvent |
createUpdateEvent(long time,
ITeamId teamId)
Creates an event updating a sharedProperty of the same id and the specified team to the same value as the parent property. |
boolean |
equals(Object another)
|
Class |
getCompositeClass()
Class of the compositeObject this property belongs to. |
WorldObjectId |
getObjectId()
ObjectId of the object that this property is part of. |
PropertyId |
getPropertyId()
Unique Id of this property. |
TYPE |
getValue()
Returns value of the property. |
int |
hashCode()
|
boolean |
isDirty()
SharedProperties are generally properties derived from bot's observation of the world. |
boolean |
nullOverrides()
|
void |
setDirty(boolean value)
|
void |
setValue(TYPE value)
Sets the value of the property - should be used by Pogamut Library developers only! |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.amis.pogamut.multi.communication.worldview.object.ISharedProperty |
---|
getPropertyValueClass |
Field Detail |
---|
protected PropertyId propertyId
protected boolean dirty
protected Class<?> compositeClass
protected TYPE value
Constructor Detail |
---|
public AbstractSharedProperty(WorldObjectId objId, String identifier, TYPE value, Class<?> compositeClass)
public AbstractSharedProperty(AbstractSharedProperty source)
source
- public AbstractSharedProperty(WorldObjectId objectId, String identifier, Class compositeClass)
objectId
- identifier
- compositeClass
- Method Detail |
---|
public boolean nullOverrides()
nullOverrides
in interface ISharedProperty<TYPE>
protected abstract TYPE cloneValue()
public int hashCode()
hashCode
in class Object
public boolean equals(Object another)
equals
in class Object
public abstract ISharedProperty<TYPE> clone()
ISharedProperty
clone
in interface ISharedProperty<TYPE>
clone
in class Object
public TYPE getValue()
ISharedProperty
getValue
in interface ISharedProperty<TYPE>
public void setValue(TYPE value)
ISharedProperty
setValue
in interface ISharedProperty<TYPE>
public Class getCompositeClass()
ISharedProperty
getCompositeClass
in interface ISharedProperty<TYPE>
public boolean isDirty()
ISharedProperty
isDirty
in interface ISharedProperty<TYPE>
public void setDirty(boolean value)
public WorldObjectId getObjectId()
ISharedProperty
getObjectId
in interface ISharedProperty<TYPE>
public PropertyId getPropertyId()
ISharedProperty
getPropertyId
in interface ISharedProperty<TYPE>
public ISharedPropertyUpdatedEvent createUpdateEvent(long time, ITeamId teamId)
ISharedProperty
createUpdateEvent
in interface ISharedProperty<TYPE>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |