info.aduna.gee.spectacle.gee
Class DefaultEntity

java.lang.Object
  extended by info.aduna.gee.spectacle.gee.DefaultEntity
All Implemented Interfaces:
Entity
Direct Known Subclasses:
InternalJitEntity

public class DefaultEntity
extends Object
implements Entity

Implementation of the Entity interface that contains no other functionality. For documentation of this class, we refer to the Entity interface. DefaultEntity is optimized for handling LARGE collections of labels (thousands of labels for thousands of objects).


Field Summary
protected  Map<Object,Object> _data
           
protected  Map<Object,Object> _transientData
           
static String DEFAULT_DESTINATION
          The default destination of Entities.
 
Constructor Summary
DefaultEntity()
           
DefaultEntity(Object id)
           
DefaultEntity(Object id, Map<Object,Object> data, Map<Object,Object> transientData, Set<String> labels, String destination)
           
 
Method Summary
 void addData(Object key, Object value)
          Add a piece of information to this Entity
 void addLabel(String label)
          Add a label to this entity.
 void addLabels(Set<String> labels)
          Add a set of labels to this entity.
 void addTransientData(Object key, Object value)
          Add a piece of transient information to this Entity.
 boolean equals(Object other)
           
 Map<Object,Object> getData()
           
 Object getData(Object key)
           
 String getDestination()
           
 Object getID()
           
 Set<String> getLabels()
           
 int getLabelsSize()
          This method is not part of Entity.
 OpaqueCLabel[] getOpaqueLabels()
          This method is not part of Entity.
 Map<Object,Object> getTransientData()
           
 int hashCode()
           
 void setData(Map<Object,Object> data)
          Set the entire set of data this Entity contains
 void setDestination(String destination)
          Set the destination (i.e.
 void setLabels(Set<String> labels)
          Set the set of labels for this entity.
 void setOpaqueLabels(OpaqueCLabel[] oclabels)
          This method is not part of Entity.
 void setTransientData(Map<Object,Object> data)
          Set the entire set of transient data this Entity contains
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DESTINATION

public static String DEFAULT_DESTINATION
The default destination of Entities.


_data

protected Map<Object,Object> _data

_transientData

protected Map<Object,Object> _transientData
Constructor Detail

DefaultEntity

public DefaultEntity()

DefaultEntity

public DefaultEntity(Object id)

DefaultEntity

public DefaultEntity(Object id,
                     Map<Object,Object> data,
                     Map<Object,Object> transientData,
                     Set<String> labels,
                     String destination)
Method Detail

getID

public Object getID()
Specified by:
getID in interface Entity
Returns:
the unique ID of this Entity

addData

public void addData(Object key,
                    Object value)
Description copied from interface: Entity
Add a piece of information to this Entity

Specified by:
addData in interface Entity
Parameters:
key - the key used to store and retrieve the information
value - the information to add

addTransientData

public void addTransientData(Object key,
                             Object value)
Description copied from interface: Entity
Add a piece of transient information to this Entity. Transient data is not returned in by getData(). For getData(key): if a key is used both non-transient and transient, the non-transient value is returned.

Specified by:
addTransientData in interface Entity
Parameters:
key - the key used to store and retrieve the information
value - the information to add

getData

public Map<Object,Object> getData()
Specified by:
getData in interface Entity
Returns:
the entire set of data this Entity contains

getTransientData

public Map<Object,Object> getTransientData()
Specified by:
getTransientData in interface Entity
Returns:
the entire set of transient data this Entity contains

getData

public Object getData(Object key)
Specified by:
getData in interface Entity
Parameters:
key - the key with which to get a piece of information
Returns:
a piece of information from this Entity, or null

setData

public void setData(Map<Object,Object> data)
Description copied from interface: Entity
Set the entire set of data this Entity contains

Specified by:
setData in interface Entity
Parameters:
data - the new data

setTransientData

public void setTransientData(Map<Object,Object> data)
Description copied from interface: Entity
Set the entire set of transient data this Entity contains

Specified by:
setTransientData in interface Entity
Parameters:
data - the new data

addLabel

public void addLabel(String label)
Description copied from interface: Entity
Add a label to this entity.

Specified by:
addLabel in interface Entity
Parameters:
label - the label to add

addLabels

public void addLabels(Set<String> labels)
Description copied from interface: Entity
Add a set of labels to this entity.

Specified by:
addLabels in interface Entity
Parameters:
labels - the set of labels to add

getLabels

public Set<String> getLabels()
Specified by:
getLabels in interface Entity
Returns:
the set of labels for this entity

setLabels

public void setLabels(Set<String> labels)
Description copied from interface: Entity
Set the set of labels for this entity.

Specified by:
setLabels in interface Entity
Parameters:
labels - the new set of labels

getOpaqueLabels

public OpaqueCLabel[] getOpaqueLabels()
This method is not part of Entity.


setOpaqueLabels

public void setOpaqueLabels(OpaqueCLabel[] oclabels)
This method is not part of Entity.


getLabelsSize

public int getLabelsSize()
This method is not part of Entity.


getDestination

public String getDestination()
Specified by:
getDestination in interface Entity
Returns:
the destination for this entity

setDestination

public void setDestination(String destination)
Description copied from interface: Entity
Set the destination (i.e. the Section it will be stored in) for this entity.

Specified by:
setDestination in interface Entity
Parameters:
destination - the new destination

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object


Copyright © 1997-2008 Aduna. All Rights Reserved.