Package moise.os.ss

Class Group

java.lang.Object
moise.common.MoiseElement
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.
Author:
Jomi Fred Hubner
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • Group

      public Group​(SS ss)
      Creates new GrSpec
    • Group

      public Group​(java.lang.String id, SS ss)
      Creates new GrSpec
  • Method Details

    • 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()
    • addRole

      public Role 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, list of sub-roles, list of super-roles, min cardinality, max cardinality, list of compatible roles, list of links).
      each link is: link(type, target, scope).

      Specified by:
      getAsProlog in interface ToProlog