Class AnnotationSelection
java.lang.Object
org.apache.uima.caseditor.editor.util.AnnotationSelection
The annotation collection contains only
AnnotationFS
s objects which are selected by a
IStructuredSelection
.
Its also possible to retrieve the first and last annotation-
Constructor Summary
ConstructorDescriptionAnnotationSelection
(Collection<FeatureStructure> structures) Initializes the current instance.AnnotationSelection
(org.eclipse.jface.viewers.IStructuredSelection selection) Initializes a the current instance with all AnnotationFS object that are contained in theStructuredSelection
. -
Method Summary
Modifier and TypeMethodDescriptiongetFirst()
Retrieves the first selected element.getLast()
Retrieves the last selected element.boolean
isEmpty()
Indicates that the selection is empty.int
size()
Retrieves the size of the collection.toList()
Retrieves an ordered list ofAnnotationFS
objects.toString()
Retrieves a human readable string.
-
Constructor Details
-
AnnotationSelection
Initializes the current instance.- Parameters:
structures
- the structures
-
AnnotationSelection
public AnnotationSelection(org.eclipse.jface.viewers.IStructuredSelection selection) Initializes a the current instance with all AnnotationFS object that are contained in theStructuredSelection
. Note:AnnotationFS
instances will be sorted in this selection, the natural oder of the selection is destroyed- Parameters:
selection
- the selection
-
-
Method Details
-
isEmpty
public boolean isEmpty()Indicates that the selection is empty.- Returns:
- true if empty false otherwise
-
size
public int size()Retrieves the size of the collection.- Returns:
- the size
-
getFirst
Retrieves the first selected element. Note: Ifsize()
== 1 then first and last element are the same instance.- Returns:
- the last element
-
getLast
Retrieves the last selected element. Note: Ifsize()
== 1 then first and last element are the same instance.- Returns:
- the last element or null if
size()
== 0
-
toList
Retrieves an ordered list ofAnnotationFS
objects.- Returns:
- all selected
AnnotationFS
objects - See Also:
-
toString
Retrieves a human readable string.
-