public class ComponentGroup extends java.lang.Object implements IComponentGroup
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List |
elements
The elements of the group
|
| Constructor and Description |
|---|
ComponentGroup()
Create a new group.
|
ComponentGroup(java.util.List elements)
Create a new group with given elements.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(java.lang.Object k)
Add an element to the group.
|
boolean |
contains(java.lang.Object k)
Check if the group contains the given element.
|
java.util.List |
getElements()
Returns a list of the elements.
|
java.lang.Object |
getSingelton()
If there is only one element in the group, return this element, else
null |
boolean |
isSingelton()
Returns
true, if there is only one one element in the group. |
java.util.Iterator |
iterator()
Returns the iterator over the elements.
|
void |
removeElement(java.lang.Object k)
Remove an element from the group.
|
int |
size()
Returns the size (number of elements) for the group.
|
public ComponentGroup()
public ComponentGroup(java.util.List elements)
elements - The elements of the new group.public void addElement(java.lang.Object k)
addElement in interface IComponentGroupk - The element to add.public void removeElement(java.lang.Object k)
removeElement in interface IComponentGroupk - The element to remove.public java.util.List getElements()
getElements in interface IComponentGrouppublic int size()
size in interface IComponentGrouppublic java.util.Iterator iterator()
iterator in interface IComponentGrouppublic boolean contains(java.lang.Object k)
contains in interface IComponentGroupk - The element to check.true if the group contains the element.public java.lang.Object getSingelton()
nullpublic boolean isSingelton()
true, if there is only one one element in the group.true if the size of the group is one.