Package org.eclipse.jface.viewers
Interface IStructuredSelection
- All Superinterfaces:
- ISelection,- Iterable
- All Known Subinterfaces:
- ITreeSelection
- All Known Implementing Classes:
- StructuredSelection,- TreeSelection
A selection containing elements.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the first element in this selection, ornullif the selection is empty.iterator()Returns an iterator over the elements of this selection.intsize()Returns the number of elements selected in this selection.stream()Returns the elements in this selection as aStream.Object[]toArray()Returns the elements in this selection as an array.toList()Returns the elements in this selection as aList.Methods inherited from interface org.eclipse.jface.viewers.ISelectionisEmptyMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Method Details- 
getFirstElementObject getFirstElement()Returns the first element in this selection, ornullif the selection is empty.- Returns:
- an element, or nullif none
 
- 
iteratorIterator iterator()Returns an iterator over the elements of this selection.
- 
sizeint size()Returns the number of elements selected in this selection.- Returns:
- the number of elements selected
 
- 
toArrayObject[] toArray()Returns the elements in this selection as an array.- Returns:
- the selected elements as an array
 
- 
toListList toList()Returns the elements in this selection as aList.- Returns:
- the selected elements as a list
 
- 
streamReturns the elements in this selection as aStream.- Returns:
- the selected elements as a stream
- Since:
- 3.32
 
 
-