org.backsource.xindice.cursor
Class BaseCursor
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
org.backsource.xindice.cursor.BaseCursor
- All Implemented Interfaces:
- java.util.Collection, Cursor, java.util.List
- Direct Known Subclasses:
- KeyCursor, SortedCursor
- public abstract class BaseCursor
- extends java.util.AbstractList
- implements Cursor
A base class for cursor working against other cursors.
This is a template class, in that subclasses must follow a certain pattern to use this as its parent. This is a greedy cursor, that expects its subclasses to swallow its source in first invokation. A subclass is expected to do its work in the swallow method. When the mothod returns it must have created an ArrayList with its result put into it.
public void swallow() throws XindiceException {
store = new ArrayList();
//Use source.iterator() to get source content
// transform
// put into store
}
- Version:
- $Revision: 1.1.1.1 $
- Author:
- Peter Antman
| Fields inherited from class java.util.AbstractList |
modCount |
|
Constructor Summary |
BaseCursor(Cursor cursor)
Use given cursor as source. |
BaseCursor(org.xmldb.api.base.ResourceSet set)
Construct a source cursor around the ResourceSet. |
| Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
| Methods inherited from class java.util.AbstractCollection |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray |
cursor
protected Cursor cursor
store
protected java.util.ArrayList store
BaseCursor
public BaseCursor(org.xmldb.api.base.ResourceSet set)
- Construct a source cursor around the ResourceSet.
BaseCursor
public BaseCursor(Cursor cursor)
- Use given cursor as source.
setSource
public void setSource(Cursor cursor)
throws XindiceException
- Specified by:
setSource in interface Cursor
- Throws:
XindiceException
get
public java.lang.Object get(int i)
throws java.lang.IndexOutOfBoundsException,
java.lang.IllegalStateException
- Specified by:
get in interface java.util.List
- Throws:
java.lang.IndexOutOfBoundsException
java.lang.IllegalStateException
size
public int size()
throws java.lang.IllegalStateException
- Specified by:
size in interface java.util.List
- Throws:
java.lang.IllegalStateException
swallow
protected abstract void swallow()
throws XindiceException
- Throws:
XindiceException
Copyright © 2003-2004 Backsource. All Rights Reserved.