moise.os.fs
Class Mission

Package class diagram package Mission
java.lang.Object
  extended by moise.common.MoiseElement
      extended by 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.

See Also:
Serialized Form

Field Summary
protected  java.util.Set<Goal> goals
           
protected  java.util.Set<Mission> preferable
           
protected  Scheme sch
           
 
Fields inherited from class moise.common.MoiseElement
debug
 
Constructor Summary
Mission(java.lang.String id, Scheme sch)
          Creates a new Mission
 
Method Summary
 void 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 Mission
 java.util.Collection<Mission> getPreferables()
          returns a collection of Mission objects preferable to this mission
static 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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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 void 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 interface java.lang.Comparable
Overrides:
compareTo in class MoiseElement

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 interface ToProlog

getXMLTag

public static java.lang.String getXMLTag()

getAsDOM

public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)
Specified by:
getAsDOM in interface ToXML

setFromDOM

public void setFromDOM(org.w3c.dom.Element ele)
                throws MoiseException
Throws:
MoiseException

toString

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