Class AnnotationSelection

java.lang.Object
org.apache.uima.caseditor.editor.util.AnnotationSelection

public class AnnotationSelection extends Object
The annotation collection contains only AnnotationFSs objects which are selected by a IStructuredSelection. Its also possible to retrieve the first and last annotation
  • Constructor Details

    • AnnotationSelection

      public AnnotationSelection(Collection<FeatureStructure> structures)
      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 the StructuredSelection. 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

      public AnnotationFS getFirst()
      Retrieves the first selected element. Note: If size() == 1 then first and last element are the same instance.
      Returns:
      the last element
    • getLast

      public AnnotationFS getLast()
      Retrieves the last selected element. Note: If size() == 1 then first and last element are the same instance.
      Returns:
      the last element or null if size() == 0
    • toList

      public List<AnnotationFS> toList()
      Retrieves an ordered list of AnnotationFS objects.
      Returns:
      all selected AnnotationFS objects
      See Also:
    • toString

      public String toString()
      Retrieves a human readable string.
      Overrides:
      toString in class Object
      Returns:
      human readable string