org.annotation.wordfreak
Class AbstractListAnnotationView

java.lang.Object
  extended byorg.annotation.wordfreak.AbstractAnnotationView
      extended byorg.annotation.wordfreak.AbstractListAnnotationView
All Implemented Interfaces:
org.annotation.wordfreak.AnnotationTreeListener, AnnotationView, javax.swing.tree.TreeModel

public abstract class AbstractListAnnotationView
extends AbstractAnnotationView


Field Summary
protected  AnnotationFilter annoFilter
           
protected  java.util.List anns
          List of annotations this view handles based on annoFilter.
protected  java.util.List base
          List of annotation on which other annotations can be constructed based on baseFilter.
protected  AnnotationFilter baseFilter
           
protected  java.util.List filt
          Subset of anns based on current filter applied.
protected  AnnotationFilter filter
           
protected  java.util.List sort
          Sorted version of filt based on comparator.
protected  java.util.Comparator sortComparator
           
 
Fields inherited from class org.annotation.wordfreak.AbstractAnnotationView
selectionMode, treeDataListeners
 
Constructor Summary
AbstractListAnnotationView()
           
 
Method Summary
 void filter(AnnotationFilter f)
          Applies the specified filter to this view.
 Annotation getAnnotation(int i)
          Returns sorted annotation at index i.
 java.util.Iterator getAnnotationIterator()
          Returns Iterator for filtered/sorted annotations.
 int getAnnotationSize()
          Returns size of filtered/sorted annotations.
 Annotation getBase(int i)
          Returns the annotation at the specified index from the list of annotations which new annotation are based on.
 java.util.Iterator getBaseIterator()
          Returns an iterator over the list of annotations which new annotation are based on.
 int getBaseSize()
          Returns the number of annotation in the list of annotations which new annotation are based on.
 int getSize()
           
 Annotation getUnsortedAnnotation(int i)
          Returns filtered annotation at index i.
 int indexOfAnnotation(Annotation a)
          Returns index of Annotation a in sorted annotations list if it is contained in the list; otherwise, (-(insertion point) - 1).
 int indexOfAnnotationOffset(int o)
          Returns index of sorted annotation which contains the offset o or the offset of the annotation which is closest.
 int indexOfBase(Annotation a)
          Returns index of Annotation a in base annotations list if it is contained in the list; otherwise, (-(insertion point) - 1).
 int indexOfBaseOffset(int o)
          Returns the index of an annotation in the list of annotations which new annotation are based on which contains the specified offset.
 int indexOfUnsortedAnnotation(Annotation a)
          Returns index of the annotation in the filtered annotations list if it is contained in the list; otherwise, (-(insertion point) - 1).
 void sort(java.util.Comparator c)
          Sorts the annotations in this view based on the specified comparison criteria.
 
Methods inherited from class org.annotation.wordfreak.AbstractAnnotationView
addTreeModelListener, close, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesMoved, fireTreeNodesRemoved, fireTreeStructureChanged, getFirstLeaf, getLastLeaf, getParent, getSelectionMode, getSortedAnnotations, getSource, removeTreeModelListener, setSelectionMode, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.annotation.wordfreak.AnnotationView
binarySearchAnnotation, binarySearchBase, chainAnnotations, containsAll, createRelation, deepInsert, deepInsert, getChain, getContainingLeaf, getNextLeaf, getPath, getPreviousLeaf, getRelation, getRelations, getRelations, getRelations, getValidSelection, getValidSelection, insert, insert, insert, insert, insert, insert, insertParent, insertParent, insertZeroLengthAnnotationAfter, insertZeroLengthAnnotationAfter, insertZeroLengthAnnotationBefore, insertZeroLengthAnnotationBefore, isTerminalSpan, move, put, put, remove, remove, remove, remove, removeFromChain, resetSelection, terminalInsert, update
 
Methods inherited from interface javax.swing.tree.TreeModel
getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, valueForPathChanged
 

Field Detail

annoFilter

protected AnnotationFilter annoFilter

baseFilter

protected AnnotationFilter baseFilter

filter

protected AnnotationFilter filter

sortComparator

protected java.util.Comparator sortComparator

filt

protected java.util.List filt
Subset of anns based on current filter applied.


anns

protected java.util.List anns
List of annotations this view handles based on annoFilter.


base

protected java.util.List base
List of annotation on which other annotations can be constructed based on baseFilter.


sort

protected java.util.List sort
Sorted version of filt based on comparator.

Constructor Detail

AbstractListAnnotationView

public AbstractListAnnotationView()
Method Detail

getSize

public int getSize()

getBase

public Annotation getBase(int i)
Description copied from interface: AnnotationView
Returns the annotation at the specified index from the list of annotations which new annotation are based on.

Parameters:
i - The index of the annotation to be returned.
Returns:
The annotation at the specified index from the list of annotations which new annotation are based on.

getBaseSize

public int getBaseSize()
Description copied from interface: AnnotationView
Returns the number of annotation in the list of annotations which new annotation are based on.

Returns:
The number of annotation in the list of annotations which new annotation are based on.

getBaseIterator

public java.util.Iterator getBaseIterator()
Description copied from interface: AnnotationView
Returns an iterator over the list of annotations which new annotation are based on.

Returns:
An iterator over the list of annotations which new annotation are based on.

getAnnotation

public Annotation getAnnotation(int i)
Description copied from interface: AnnotationView
Returns sorted annotation at index i.

Parameters:
i - index
Returns:
sorted annotation at index i.

getUnsortedAnnotation

public Annotation getUnsortedAnnotation(int i)
Description copied from interface: AnnotationView
Returns filtered annotation at index i.

Parameters:
i - index
Returns:
filtered annotation at index i.

getAnnotationSize

public int getAnnotationSize()
Description copied from interface: AnnotationView
Returns size of filtered/sorted annotations.

Returns:
returns size of filtered/sorted annotations.

getAnnotationIterator

public java.util.Iterator getAnnotationIterator()
Description copied from interface: AnnotationView
Returns Iterator for filtered/sorted annotations.

Returns:
Iterator for filtered annotations.

indexOfAnnotation

public int indexOfAnnotation(Annotation a)
Description copied from interface: AnnotationView
Returns index of Annotation a in sorted annotations list if it is contained in the list; otherwise, (-(insertion point) - 1).

Parameters:
a - Annotation.
Returns:
index of the Annotation a in sorted annotaitons list if it is contained in the list; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the filtered annotations list: the index of the first element greater than the key, or list.size(), if all elements in the list are less than the specified Annotation.

indexOfAnnotationOffset

public int indexOfAnnotationOffset(int o)
Description copied from interface: AnnotationView
Returns index of sorted annotation which contains the offset o or the offset of the annotation which is closest.

Parameters:
o - offset.
Returns:
index of sorted annotation which contains the offset o or the offset of the annotation which is closest.

indexOfUnsortedAnnotation

public int indexOfUnsortedAnnotation(Annotation a)
Description copied from interface: AnnotationView
Returns index of the annotation in the filtered annotations list if it is contained in the list; otherwise, (-(insertion point) - 1).

Parameters:
a - Annotation.
Returns:
index of the Annotation a in the filtered annotaitons list if it is contained in the list; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the filtered annotations list: the index of the first element greater than the key, or list.size(), if all elements in the list are less than the specified Annotation.

indexOfBase

public int indexOfBase(Annotation a)
Description copied from interface: AnnotationView
Returns index of Annotation a in base annotations list if it is contained in the list; otherwise, (-(insertion point) - 1).

Parameters:
a - The annotation whose index is being searched for.
Returns:
index of the Annotation a in base annotaitons list if it is contained in the list; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the base annotations list: the index of the first element greater than the key, or list.size(), if all elements in the list are less than the specified Annotation.

indexOfBaseOffset

public int indexOfBaseOffset(int o)
Description copied from interface: AnnotationView
Returns the index of an annotation in the list of annotations which new annotation are based on which contains the specified offset.

Parameters:
o - The offset the base annotation at the returned index will contain.
Returns:
The index of an annotation in the list of annotations which new annotation are based on which contains the specified offset or (-(insertion point) - 1) of such an annotation if no such annotation exist.

sort

public void sort(java.util.Comparator c)
Description copied from interface: AnnotationView
Sorts the annotations in this view based on the specified comparison criteria.

Parameters:
c - The criteria on which the sort is based.

filter

public void filter(AnnotationFilter f)
Description copied from interface: AnnotationView
Applies the specified filter to this view.

Parameters:
f - The filter to be applied to this view.


Copyright © 2004 Thomas Morton and Jeremy LaCivita. All Rights Reserved.