Class AnnotationSelection
java.lang.Object
org.apache.uima.caseditor.editor.util.AnnotationSelection
The annotation collection contains only
AnnotationFSs objects which are selected by a
IStructuredSelection.
Its also possible to retrieve the first and last annotation-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationSelection(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.booleanisEmpty()Indicates that the selection is empty.intsize()Retrieves the size of the collection.toList()Retrieves an ordered list ofAnnotationFSobjects.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:AnnotationFSinstances 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 ofAnnotationFSobjects.- Returns:
- all selected
AnnotationFSobjects - See Also:
-
toString
Retrieves a human readable string.
-