Package moise.os.fs
Class Mission
- java.lang.Object
-
- moise.common.MoiseElement
-
- moise.os.fs.Mission
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable
,Identifiable
,ToProlog
,ToXML
public class Mission extends MoiseElement implements ToXML, ToProlog
Represents a Mission. The mission id is prefixed by the scheme id.- Author:
- Jomi Fred Hubner
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<Goal>
goals
protected java.util.Set<Mission>
preferable
protected Scheme
sch
private static long
serialVersionUID
-
Fields inherited from class moise.common.MoiseElement
debug
-
-
Method Summary
Modifier and Type Method Description Goal
addGoal(java.lang.String goalSpecId)
void
addPreferable(java.lang.String missionId)
int
compareTo(java.lang.Object o)
java.util.Collection<Mission>
getAllPreferables()
returns a collection of Mission objects preferable to this mission including the transitivity of the preference relation.org.w3c.dom.Element
getAsDOM(org.w3c.dom.Document document)
java.lang.String
getAsProlog()
returns a string representing the goal in Prolog syntax, format: mission(id,min,max cardinality,list of goals,list of preferred missions)java.util.Collection<Goal>
getGoals()
returns a collection of GoalSpec objects of this Missionjava.util.Collection<Mission>
getPreferables()
returns a collection of Mission objects preferable to this missionstatic java.lang.String
getXMLTag()
void
setFromDOM(org.w3c.dom.Element ele)
java.lang.String
toString()
-
Methods inherited from class moise.common.MoiseElement
equals, getBoolProperty, getBoolProperty, getCreationDate, getFullId, getId, getId, getOwner, getPrefix, getPrefix, getProperties, getPropertiesAsDOM, getPropertiesAsProlog, getProperty, getStrProperty, hashCode, setId, setOwner, setPrefix, setPropertiesFromDOM, setProperty
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
goals
protected java.util.Set<Goal> goals
-
preferable
protected java.util.Set<Mission> preferable
-
sch
protected Scheme sch
-
-
Constructor Detail
-
Mission
public Mission(java.lang.String id, Scheme sch)
Creates a new Mission- Parameters:
id
- the identification of the role
-
-
Method Detail
-
addGoal
public Goal addGoal(java.lang.String goalSpecId) throws MoiseConsistencyException
- Throws:
MoiseConsistencyException
-
getGoals
public java.util.Collection<Goal> getGoals()
returns a collection of GoalSpec objects of this Mission
-
addPreferable
public void addPreferable(java.lang.String missionId) throws MoiseConsistencyException
- Throws:
MoiseConsistencyException
-
getPreferables
public java.util.Collection<Mission> getPreferables()
returns a collection of Mission objects preferable to this mission
-
getAllPreferables
public java.util.Collection<Mission> getAllPreferables()
returns a collection of Mission objects preferable to this mission including the transitivity of the preference relation. For instance, if one has m1 < m2 (m2 has greater preference); m2 < m3; m2 < m4; m4 < m5, for m1, this method will return {m2, m3, m4, m5}
-
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareTo
in interfacejava.lang.Comparable
- Overrides:
compareTo
in classMoiseElement
-
getAsProlog
public java.lang.String getAsProlog()
returns a string representing the goal in Prolog syntax, format: mission(id,min,max cardinality,list of goals,list of preferred missions)- Specified by:
getAsProlog
in interfaceToProlog
-
getXMLTag
public static java.lang.String getXMLTag()
-
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)
-
setFromDOM
public void setFromDOM(org.w3c.dom.Element ele) throws MoiseException
- Throws:
MoiseException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classMoiseElement
-
-