Package moise.common
Class MoiseElement
- java.lang.Object
-
- moise.common.MoiseElement
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable
,Identifiable
- Direct Known Subclasses:
FS
,Goal
,GoalInstance
,Group
,GroupInstance
,Mission
,Norm
,NS
,OEAgent
,OS
,Plan
,PlanInstance
,Role
,RoleRel
,Scheme
,SchemeInstance
,SS
public class MoiseElement extends java.lang.Object implements java.io.Serializable, Identifiable, java.lang.Comparable
Represents a basic Moise+ element which has an Id (a "player" Role, for example). Some elements may have an id composed by prefix.id- Author:
- Jomi Fred Hubner
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Date
creationDate
static boolean
debug
private java.lang.String
id
private static int
lastId
private OEAgent
owner
private java.lang.String
prefix
private java.util.Map<java.lang.String,java.lang.Object>
properties
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description MoiseElement()
MoiseElement(java.lang.String id)
-
Method Summary
Modifier and Type Method Description int
compareTo(java.lang.Object obj)
boolean
equals(java.lang.Object o)
boolean
getBoolProperty(java.lang.String id)
boolean
getBoolProperty(java.lang.String id, boolean defaultReturn)
java.util.Date
getCreationDate()
java.lang.String
getFullId()
returns a full id : prefix + "." + id if there is a prefix, onlyotherwise. java.lang.String
getId()
static java.lang.String
getId(java.lang.String s)
get the id part of a string with the format prefix.id, return "id" if there is no prefixOEAgent
getOwner()
java.lang.String
getPrefix()
static java.lang.String
getPrefix(java.lang.String s)
get the prefix part of a string with the format prefix.id, returns null if there is no prefixjava.util.Map<java.lang.String,java.lang.Object>
getProperties()
org.w3c.dom.Element
getPropertiesAsDOM(org.w3c.dom.Document document)
java.lang.String
getPropertiesAsProlog()
java.lang.Object
getProperty(java.lang.String id)
java.lang.String
getStrProperty(java.lang.String id, java.lang.String defaultReturn)
int
hashCode()
void
setId(java.lang.String s)
void
setOwner(OEAgent ag)
void
setPrefix(java.lang.String p)
void
setPropertiesFromDOM(org.w3c.dom.Element parent)
void
setProperty(java.lang.String id, java.lang.Object value)
java.lang.String
toString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
debug
public static boolean debug
-
id
private java.lang.String id
-
prefix
private java.lang.String prefix
-
owner
private OEAgent owner
-
creationDate
private java.util.Date creationDate
-
properties
private java.util.Map<java.lang.String,java.lang.Object> properties
-
lastId
private static int lastId
-
-
Method Detail
-
getId
public java.lang.String getId()
- Specified by:
getId
in interfaceIdentifiable
-
setId
public void setId(java.lang.String s)
-
setOwner
public void setOwner(OEAgent ag)
-
getOwner
public OEAgent getOwner()
-
getCreationDate
public java.util.Date getCreationDate()
-
setPrefix
public void setPrefix(java.lang.String p)
-
getPrefix
public java.lang.String getPrefix()
- Specified by:
getPrefix
in interfaceIdentifiable
-
getFullId
public java.lang.String getFullId()
returns a full id : prefix + "." + id if there is a prefix, onlyotherwise. - Specified by:
getFullId
in interfaceIdentifiable
-
setProperty
public void setProperty(java.lang.String id, java.lang.Object value)
-
getProperty
public java.lang.Object getProperty(java.lang.String id)
-
getStrProperty
public java.lang.String getStrProperty(java.lang.String id, java.lang.String defaultReturn)
-
getBoolProperty
public boolean getBoolProperty(java.lang.String id)
-
getBoolProperty
public boolean getBoolProperty(java.lang.String id, boolean defaultReturn)
-
getProperties
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object obj)
- Specified by:
compareTo
in interfacejava.lang.Comparable
-
getPrefix
public static java.lang.String getPrefix(java.lang.String s)
get the prefix part of a string with the format prefix.id, returns null if there is no prefix
-
getId
public static java.lang.String getId(java.lang.String s)
get the id part of a string with the format prefix.id, return "id" if there is no prefix
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getPropertiesAsDOM
public org.w3c.dom.Element getPropertiesAsDOM(org.w3c.dom.Document document)
-
getPropertiesAsProlog
public java.lang.String getPropertiesAsProlog()
-
setPropertiesFromDOM
public void setPropertiesFromDOM(org.w3c.dom.Element parent)
-
-