Package org.cytoscape.work.util
Class ListSingleSelection<T>
java.lang.Object
org.cytoscape.work.util.ListSelection<T>
org.cytoscape.work.util.ListSingleSelection<T>
- Type Parameters:
T
- type of items that will be listed.
List with items of type
T
: only 1 item can be selected.Cytoscape Backwards Compatibility (Final Class): This class is final and therefore can't be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
Module: work-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>work-api</artifactId> </dependency>
-
Field Summary
Fields inherited from class org.cytoscape.work.util.ListSelection
values
-
Constructor Summary
ConstructorDescriptionListSingleSelection
(List<T> values) Creates a new ListSingleSelection object.ListSingleSelection
(T... values) Creates a new ListSingleSelection object. -
Method Summary
Modifier and TypeMethodDescriptionGet the item that is currently selected.void
setSelectedValue
(T val) Set theval
item of typeT
as selected in the ListSingleSelection.Methods inherited from class org.cytoscape.work.util.ListSelection
addListener, getListeners, getPossibleValues, listChanged, removeListener, selectionChanged, setPossibleValues
-
Constructor Details
-
ListSingleSelection
Creates a new ListSingleSelection object.example :
ListSingleSelection
lss = new ListSingleSelection ("1","2","3","4") - Parameters:
values
- An arbitrary number of values of type T that can be selected.
-
ListSingleSelection
Creates a new ListSingleSelection object.example :
List
list = ArrayList (); list.add("1"); list.add("2"); list.add("3"); list.add("4"); ListSingleSelection lss = new ListSingleSelection (list); - Parameters:
values
- The list of values of type T that can be selected. This list may be empty, but not null.
-
-
Method Details
-
getSelectedValue
Get the item that is currently selected.- Returns:
- the selected item.
-
setSelectedValue
Set theval
item of typeT
as selected in the ListSingleSelection.- Parameters:
val
- the selected item.
-