yu.ac.bg.etf.javaqx.qswing
Class SelectableGroup

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.qswing.SelectableGroup

public class SelectableGroup
extends java.lang.Object

Group of Selectable Objects.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Constructor Summary
SelectableGroup()
          Constructs new SelectableGroup object.
SelectableGroup(int initialCapacity)
          Constructs new SelectableGroup object.
 
Method Summary
 void add(Selectable selectable)
          Adds selectable to this group.
 Selectable getSelectable(int index)
          Returns selectable at specified index.
 int getSelectableCount()
          Returns the number of selectable objects in this group.
 java.util.Iterator getSelectables()
          Returns iterator over the selectable elements of this group.
 Selectable getSelected()
          Returns selectable object.
 boolean isSelected(Selectable selectable)
          Returns true if specified selectable object is member of this group and it is selected; otherwise returns false.
 void remove(Selectable selectable)
          Removes selectable from this group.
 void removeAll()
          Removes all selectables.
 boolean setSelected(Selectable selectable)
          Sets selected state for the specified selectable object in the group.
 void trimToSize()
          Trims the capacity of group to be the same as the size of the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectableGroup

public SelectableGroup()
Constructs new SelectableGroup object.


SelectableGroup

public SelectableGroup(int initialCapacity)
Constructs new SelectableGroup object.

Parameters:
initialCapacity - the initial capacity of the group
Throws:
java.lang.IllegalArgumentException - if the initial capacity is negative
Method Detail

add

public void add(Selectable selectable)
Adds selectable to this group.

Parameters:
selectable - the selectable to be added

remove

public void remove(Selectable selectable)
Removes selectable from this group.

Parameters:
selectable - the selectable to be removed

removeAll

public void removeAll()
Removes all selectables.


getSelectableCount

public int getSelectableCount()
Returns the number of selectable objects in this group.

Returns:
the number of selectable objects in this group

getSelectable

public Selectable getSelectable(int index)
Returns selectable at specified index.

Parameters:
index - the index
Returns:
selectable at specified index

trimToSize

public void trimToSize()
Trims the capacity of group to be the same as the size of the group.


getSelectables

public java.util.Iterator getSelectables()
Returns iterator over the selectable elements of this group.

Returns:
iterator over the selectable elements of this group

isSelected

public boolean isSelected(Selectable selectable)
Returns true if specified selectable object is member of this group and it is selected; otherwise returns false.

Parameters:
selectable - the selectable object.
Returns:
true if specified selectable object is member of this selectable group and it is selected

getSelected

public Selectable getSelected()
Returns selectable object.

Returns:
selectable object

setSelected

public boolean setSelected(Selectable selectable)
Sets selected state for the specified selectable object in the group.

Parameters:
selectable - the selectable object
Returns:
true if current selectable object can be deselected


Copyright © 2007 ETF and contributors. All Rights Reserved.