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>compatibilitiesprotected java.util.Set<Link>linksprotected CardinalitySet<Role>rolesprivate static longserialVersionUIDprotected SSssprotected CardinalitySet<Group>subgroupsprotected GroupsuperGrFields inherited from class moise.common.MoiseElement
debug -
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidaddCompatibility(Compatibility c)voidaddLink(Link l)RoleaddRole(java.lang.String roleId)adds the roleId role into the playable roles in this groupvoidaddSubGroup(Group gr)booleancontainsRole(Role r)checks whether the roleId can be played in this groupGroupfindSubGroup(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.ElementgetAsDOM(org.w3c.dom.Document document)java.lang.StringgetAsProlog()returns a string as a prolog predicate representing the group specification.java.util.Collection<Compatibility>getCompatibilities()return a collection of this group Compatibility objectsintgetCompatibilitiesQty()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 groupintgetLinksQty()CardinalitygetRoleCardinality(Role role)returns the cardinality for the. CardinalitySet<Role>getRoles()returns a collection of this group's rolesSSgetSS()GroupgetSubGroup(java.lang.String grId)gets the grId subgroup of this group (does not looks for the subgroups' subgroups)CardinalitygetSubGroupCardinality(Group gr)CardinalitySet<Group>getSubGroups()gets the direct sub groups of this groupGroupgetSuperGroup()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.StringgetXMLTag()booleanisRoot()returns true if this group is not a subgroup of another groupvoidremoveRole(java.lang.String roleId)removes the roleId role from the playable roles in this groupvoidsetFromDOM(org.w3c.dom.Element ele)voidsetRoleCardinality(java.lang.String roleId, Cardinality c)voidsetSubGroupCardinality(java.lang.String grId, Cardinality c)protected voidsetSuperGroup(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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
roles
-
subgroups
-
superGr
-
links
-
compatibilities
-
ss
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
-
Constructor Details
-
Group
Creates new GrSpec -
Group
Creates new GrSpec
-
-
Method Details
-
setSuperGroup
-
getSuperGroup
-
isRoot
public boolean isRoot()returns true if this group is not a subgroup of another group -
getSS
-
addRole
adds the roleId role into the playable roles in this group- Throws:
MoiseConsistencyException
-
removeRole
removes the roleId role from the playable roles in this group- Throws:
MoiseConsistencyException
-
containsRole
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
returns the cardinality for the. If it is not defined, returns null. -
getRoles
returns a collection of this group's roles -
addLink
-
getLinks
returns a collection for the Link objects defined in this group -
getLinksQty
public int getLinksQty() -
getUpLinks
gets the links of this group an its supergroups's extendible links -
getExtendibleLinks
gets the group's Link objects which are extendible to sub groups -
addCompatibility
-
getExtendibleCompatibilities
gets the group's Compatibility objects which are extendible to sub groups -
getUpCompatibilities
gets the Compatibility objects of this group an its supergroups's Extendible compatibilities -
getCompatibilities
return a collection of this group Compatibility objects -
getCompatibilitiesQty
public int getCompatibilitiesQty() -
addSubGroup
-
getSubGroups
gets the direct sub groups of this group -
getAllSubGroupsTree
gets this group and its all sub groups, the subgroups of the subgroups, ..... -
getSubGroup
gets the grId subgroup of this group (does not looks for the subgroups' subgroups) -
findSubGroup
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
-
getXMLTag
public static java.lang.String getXMLTag() -
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document) -
setFromDOM
- 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:
getAsPrologin interfaceToProlog
-