public class Group extends MoiseElement implements ToXML, ToProlog
Modifier and Type | Field and Description |
---|---|
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 |
debug
Constructor and Description |
---|
Group(SS ss)
Creates new GrSpec
|
Group(java.lang.String id,
SS ss)
Creates new GrSpec
|
Modifier and Type | Method and Description |
---|---|
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) |
compareTo, equals, getBoolProperty, getBoolProperty, getCreationDate, getFullId, getId, getId, getOwner, getPrefix, getPrefix, getProperties, getPropertiesAsDOM, getPropertiesAsProlog, getProperty, getStrProperty, hashCode, setId, setOwner, setPrefix, setPropertiesFromDOM, setProperty, toString
protected CardinalitySet<Role> roles
protected CardinalitySet<Group> subgroups
protected Group superGr
protected java.util.Set<Link> links
protected java.util.Set<Compatibility> compatibilities
protected java.lang.String monitoring
protected SS ss
public Group(SS ss)
public Group(java.lang.String id, SS ss)
protected void setSuperGroup(Group gr)
public Group getSuperGroup()
public boolean isRoot()
public SS getSS()
public void setMonitoringSch(java.lang.String schId)
public java.lang.String getMonitoringSch()
public void addRole(java.lang.String roleId) throws MoiseConsistencyException
MoiseConsistencyException
public void removeRole(java.lang.String roleId) throws MoiseConsistencyException
MoiseConsistencyException
public boolean containsRole(Role r)
public void setRoleCardinality(java.lang.String roleId, Cardinality c) throws MoiseConsistencyException
MoiseConsistencyException
public Cardinality getRoleCardinality(Role role)
public CardinalitySet<Role> getRoles()
public void addLink(Link l)
public java.util.Collection<Link> getLinks()
public int getLinksQty()
public java.util.Set<Link> getUpLinks()
public java.util.Collection<Link> getExtendibleLinks()
public void addCompatibility(Compatibility c)
public java.util.Collection<Compatibility> getExtendibleCompatibilities()
public java.util.Collection<Compatibility> getUpCompatibilities()
public java.util.Collection<Compatibility> getCompatibilities()
public int getCompatibilitiesQty()
public void addSubGroup(Group gr)
public CardinalitySet<Group> getSubGroups()
public java.util.Collection<Group> getAllSubGroupsTree()
public Group getSubGroup(java.lang.String grId)
public Group findSubGroup(java.lang.String grId)
public void setSubGroupCardinality(java.lang.String grId, Cardinality c) throws MoiseConsistencyException
MoiseConsistencyException
public Cardinality getSubGroupCardinality(Group gr)
public static java.lang.String getXMLTag()
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)
public void setFromDOM(org.w3c.dom.Element ele) throws MoiseException
MoiseException
public java.lang.String getAsProlog()
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).
getAsProlog
in interface ToProlog