moise.os.ss
Class Group

Package class diagram package Group
java.lang.Object
  extended by moise.common.MoiseElement
      extended by moise.os.ss.Group
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, Identifiable, ToProlog, ToXML

public class Group
extends MoiseElement
implements ToXML, ToProlog

Represents a Group Specification.

See Also:
Serialized Form

Field Summary
protected  java.util.Set<Compatibility> compatibilities
           
protected  java.util.Set<Link> links
           
protected  java.lang.String monitoring
           
protected  CardinalitySet<Role> roles
           
protected  SS ss
           
protected  CardinalitySet<Group> subgroups
           
protected  Group superGr
           
 
Fields inherited from class moise.common.MoiseElement
debug
 
Constructor Summary
Group(SS ss)
          Creates new GrSpec
Group(java.lang.String id, SS ss)
          Creates new GrSpec
 
Method Summary
 void addCompatibility(Compatibility c)
           
 void addLink(Link l)
           
 void addRole(java.lang.String roleId)
          adds the roleId role into the playable roles in this group
 void addSubGroup(Group gr)
           
 boolean containsRole(Role r)
          checks whether the roleId can be played in this group
 Group findSubGroup(java.lang.String grId)
          looks for grId in this group and in its subgroups
 java.util.Collection<Group> getAllSubGroupsTree()
          gets this group and its all sub groups, the subgroups of the subgroups, .....
 org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)
           
 java.lang.String getAsProlog()
          returns a string as a prolog predicate representing the group specification.
 java.util.Collection<Compatibility> getCompatibilities()
          return a collection of this group Compatibility objects
 int getCompatibilitiesQty()
           
 java.util.Collection<Compatibility> getExtendibleCompatibilities()
          gets the group's Compatibility objects which are extendible to sub groups
 java.util.Collection<Link> getExtendibleLinks()
          gets the group's Link objects which are extendible to sub groups
 java.util.Collection<Link> getLinks()
          returns a collection for the Link objects defined in this group
 int getLinksQty()
           
 java.lang.String getMonitoringSch()
           
 Cardinality getRoleCardinality(Role role)
          returns the cardinality for the .
 CardinalitySet<Role> getRoles()
          returns a collection of this group's roles
 SS getSS()
           
 Group getSubGroup(java.lang.String grId)
          gets the grId subgroup of this group (does not looks for the subgroups' subgroups)
 Cardinality getSubGroupCardinality(Group gr)
           
 CardinalitySet<Group> getSubGroups()
          gets the direct sub groups of this group
 Group getSuperGroup()
           
 java.util.Collection<Compatibility> getUpCompatibilities()
          gets the Compatibility objects of this group an its supergroups's Extendible compatibilities
 java.util.Set<Link> getUpLinks()
          gets the links of this group an its supergroups's extendible links
static java.lang.String getXMLTag()
           
 boolean isRoot()
          returns true if this group is not a subgroup of another group
 void removeRole(java.lang.String roleId)
          removes the roleId role from the playable roles in this group
 void setFromDOM(org.w3c.dom.Element ele)
           
 void setMonitoringSch(java.lang.String schId)
           
 void setRoleCardinality(java.lang.String roleId, Cardinality c)
           
 void setSubGroupCardinality(java.lang.String grId, Cardinality c)
           
protected  void setSuperGroup(Group gr)
           
 
Methods inherited from class moise.common.MoiseElement
compareTo, equals, getBoolProperty, getBoolProperty, getCreationDate, getFullId, getId, getId, getOwner, getPrefix, getPrefix, getProperties, getPropertiesAsDOM, getPropertiesAsProlog, getProperty, getStrProperty, hashCode, setId, setOwner, setPrefix, setPropertiesFromDOM, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

roles

protected CardinalitySet<Role> roles

subgroups

protected CardinalitySet<Group> subgroups

superGr

protected Group superGr

links

protected java.util.Set<Link> links

compatibilities

protected java.util.Set<Compatibility> compatibilities

monitoring

protected java.lang.String monitoring

ss

protected SS ss
Constructor Detail

Group

public Group(SS ss)
Creates new GrSpec


Group

public Group(java.lang.String id,
             SS ss)
Creates new GrSpec

Method Detail

setSuperGroup

protected void setSuperGroup(Group gr)

getSuperGroup

public Group getSuperGroup()

isRoot

public boolean isRoot()
returns true if this group is not a subgroup of another group


getSS

public SS getSS()

setMonitoringSch

public void setMonitoringSch(java.lang.String schId)

getMonitoringSch

public java.lang.String getMonitoringSch()

addRole

public void addRole(java.lang.String roleId)
             throws MoiseConsistencyException
adds the roleId role into the playable roles in this group

Throws:
MoiseConsistencyException

removeRole

public void removeRole(java.lang.String roleId)
                throws MoiseConsistencyException
removes the roleId role from the playable roles in this group

Throws:
MoiseConsistencyException

containsRole

public boolean containsRole(Role r)
checks whether the roleId can be played in this group


setRoleCardinality

public void setRoleCardinality(java.lang.String roleId,
                               Cardinality c)
                        throws MoiseConsistencyException
Throws:
MoiseConsistencyException

getRoleCardinality

public Cardinality getRoleCardinality(Role role)
returns the cardinality for the . If it is not defined, returns null.


getRoles

public CardinalitySet<Role> getRoles()
returns a collection of this group's roles


addLink

public void addLink(Link l)

getLinks

public java.util.Collection<Link> getLinks()
returns a collection for the Link objects defined in this group


getLinksQty

public int getLinksQty()

getUpLinks

public java.util.Set<Link> getUpLinks()
gets the links of this group an its supergroups's extendible links


getExtendibleLinks

public java.util.Collection<Link> getExtendibleLinks()
gets the group's Link objects which are extendible to sub groups


addCompatibility

public void addCompatibility(Compatibility c)

getExtendibleCompatibilities

public java.util.Collection<Compatibility> getExtendibleCompatibilities()
gets the group's Compatibility objects which are extendible to sub groups


getUpCompatibilities

public java.util.Collection<Compatibility> getUpCompatibilities()
gets the Compatibility objects of this group an its supergroups's Extendible compatibilities


getCompatibilities

public java.util.Collection<Compatibility> getCompatibilities()
return a collection of this group Compatibility objects


getCompatibilitiesQty

public int getCompatibilitiesQty()

addSubGroup

public void addSubGroup(Group gr)

getSubGroups

public CardinalitySet<Group> getSubGroups()
gets the direct sub groups of this group


getAllSubGroupsTree

public java.util.Collection<Group> getAllSubGroupsTree()
gets this group and its all sub groups, the subgroups of the subgroups, .....


getSubGroup

public Group getSubGroup(java.lang.String grId)
gets the grId subgroup of this group (does not looks for the subgroups' subgroups)


findSubGroup

public Group findSubGroup(java.lang.String grId)
looks for grId in this group and in its subgroups


setSubGroupCardinality

public void setSubGroupCardinality(java.lang.String grId,
                                   Cardinality c)
                            throws MoiseConsistencyException
Throws:
MoiseConsistencyException

getSubGroupCardinality

public Cardinality getSubGroupCardinality(Group gr)

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

getAsProlog

public java.lang.String getAsProlog()
returns a string as a prolog predicate representing the group specification.

The format is: group_specification(group type id, list of role, list of subgroups, properties).
each role in the list is: role(id,min cardinality, max cardinality, list of compatible roles, list of links).
each link is: link(type, target, scopo).

Specified by:
getAsProlog in interface ToProlog