modhelxs.abstractsemantics
Class NamedEntity

java.lang.Object
  extended by modhelxs.abstractsemantics.NamedEntity
All Implemented Interfaces:
NamedEntity
Direct Known Subclasses:
BlockStructure, Engine, ModelOfComputation, ObservableEntity, Pin, Relation

public abstract class NamedEntity
extends java.lang.Object
implements NamedEntity

Implementation of a Named entity for the abstract semantics of ModHel'X.

Author:
boulange

Field Summary
private  java.lang.String name_
          Name of the entity.
private  java.util.Map<java.lang.String,java.lang.Object> properties_
          Properties of the entity.
 
Constructor Summary
NamedEntity(java.lang.String name, java.lang.Object... properties)
           
 
Method Summary
 java.lang.String getName()
          Get the name of this entity.
 java.util.Collection<java.lang.String> getProperties()
          Get the properties of this entity.
<T> T
getProperty(java.lang.String name, java.lang.Class<T> type)
          Get property name of the entity as a Class.
 boolean hasProperty(java.lang.String name)
          Tell if the entity has property name.
<T> void
removeProperty(java.lang.String name)
          Remove property name of the entity.
 void setName(java.lang.String name)
          Set the name of this entity.
 void setProperties(java.lang.Object... pairs)
          Set properties of the entity using a String/value list.
<T> void
setProperty(java.lang.String name, T value)
          Set property name of the entity to value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name_

private java.lang.String name_
Name of the entity.


properties_

private java.util.Map<java.lang.String,java.lang.Object> properties_
Properties of the entity.

Constructor Detail

NamedEntity

public NamedEntity(java.lang.String name,
                   java.lang.Object... properties)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: NamedEntity
Get the name of this entity.

Specified by:
getName in interface NamedEntity

setName

public void setName(java.lang.String name)
Description copied from interface: NamedEntity
Set the name of this entity.

Specified by:
setName in interface NamedEntity

getProperties

public java.util.Collection<java.lang.String> getProperties()
Description copied from interface: NamedEntity
Get the properties of this entity.

Specified by:
getProperties in interface NamedEntity

hasProperty

public boolean hasProperty(java.lang.String name)
Tell if the entity has property name.


getProperty

public <T> T getProperty(java.lang.String name,
                         java.lang.Class<T> type)
Get property name of the entity as a Class.


setProperty

public <T> void setProperty(java.lang.String name,
                            T value)
Set property name of the entity to value.


setProperties

public void setProperties(java.lang.Object... pairs)
Set properties of the entity using a String/value list.


removeProperty

public <T> void removeProperty(java.lang.String name)
Remove property name of the entity.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object