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 Summary
Fields Modifier and Type Field Description protected java.util.Set<Compatibility>
compatibilities
protected java.util.Set<Link>
links
protected CardinalitySet<Role>
roles
private static long
serialVersionUID
protected SS
ss
protected CardinalitySet<Group>
subgroups
protected Group
superGr
-
Fields inherited from class moise.common.MoiseElement
debug
-
-
Method Summary
Modifier and Type Method Description void
addCompatibility(Compatibility c)
void
addLink(Link l)
Role
addRole(java.lang.String roleId)
adds the roleId role into the playable roles in this groupvoid
addSubGroup(Group gr)
boolean
containsRole(Role r)
checks whether the roleId can be played in this groupGroup
findSubGroup(java.lang.String grId)
looks for grId in this group and in its subgroupsjava.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 objectsint
getCompatibilitiesQty()
java.util.Collection<Compatibility>
getExtendibleCompatibilities()
gets the group's Compatibility objects which are extendible to sub groupsjava.util.Collection<Link>
getExtendibleLinks()
gets the group's Link objects which are extendible to sub groupsjava.util.Collection<Link>
getLinks()
returns a collection for the Link objects defined in this groupint
getLinksQty()
Cardinality
getRoleCardinality(Role role)
returns the cardinality for the. CardinalitySet<Role>
getRoles()
returns a collection of this group's rolesSS
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 groupGroup
getSuperGroup()
java.util.Collection<Compatibility>
getUpCompatibilities()
gets the Compatibility objects of this group an its supergroups's Extendible compatibilitiesjava.util.Set<Link>
getUpLinks()
gets the links of this group an its supergroups's extendible linksstatic java.lang.String
getXMLTag()
boolean
isRoot()
returns true if this group is not a subgroup of another groupvoid
removeRole(java.lang.String roleId)
removes the roleId role from the playable roles in this groupvoid
setFromDOM(org.w3c.dom.Element ele)
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
-
-
-
-
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
-
ss
protected SS ss
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
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()
-
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)
-
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 interfaceToProlog
-
-