Package jadex.tools.comanalyzer.graph
Class ComponentGroup
- java.lang.Object
- 
- jadex.tools.comanalyzer.graph.ComponentGroup
 
- 
- All Implemented Interfaces:
- IComponentGroup
 - Direct Known Subclasses:
- GraphCanvas.AgentGroup,- GraphCanvas.MessageGroup
 
 public class ComponentGroup extends java.lang.Object implements IComponentGroup Base class for Groups (of Agents or Messages) in the ComponentGroupMultiGraph.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.ListelementsThe elements of the group
 - 
Constructor SummaryConstructors Constructor Description ComponentGroup()Create a new group.ComponentGroup(java.util.List elements)Create a new group with given elements.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddElement(java.lang.Object k)Add an element to the group.booleancontains(java.lang.Object k)Check if the group contains the given element.java.util.ListgetElements()Returns a list of the elements.java.lang.ObjectgetSingelton()If there is only one element in the group, return this element, elsenullbooleanisSingelton()Returnstrue, if there is only one one element in the group.java.util.Iteratoriterator()Returns the iterator over the elements.voidremoveElement(java.lang.Object k)Remove an element from the group.intsize()Returns the size (number of elements) for the group.
 
- 
- 
- 
Method Detail- 
addElementpublic void addElement(java.lang.Object k) Add an element to the group.- Specified by:
- addElementin interface- IComponentGroup
- Parameters:
- k- The element to add.
 
 - 
removeElementpublic void removeElement(java.lang.Object k) Remove an element from the group.- Specified by:
- removeElementin interface- IComponentGroup
- Parameters:
- k- The element to remove.
 
 - 
getElementspublic java.util.List getElements() Returns a list of the elements.- Specified by:
- getElementsin interface- IComponentGroup
- Returns:
- The list of element.
 
 - 
sizepublic int size() Returns the size (number of elements) for the group.- Specified by:
- sizein interface- IComponentGroup
- Returns:
- The size of the group.
 
 - 
iteratorpublic java.util.Iterator iterator() Returns the iterator over the elements.- Specified by:
- iteratorin interface- IComponentGroup
- Returns:
- The iterator
 
 - 
containspublic boolean contains(java.lang.Object k) Check if the group contains the given element.- Specified by:
- containsin interface- IComponentGroup
- Parameters:
- k- The element to check.
- Returns:
- trueif the group contains the element.
 
 - 
getSingeltonpublic java.lang.Object getSingelton() If there is only one element in the group, return this element, elsenull- Returns:
- The element if there is only one element in the group.
 
 - 
isSingeltonpublic boolean isSingelton() Returnstrue, if there is only one one element in the group.- Returns:
- trueif the size of the group is one.
 
 
- 
 
-