org.josql.incubator
Class ObjectIndex
java.lang.Object
org.josql.incubator.ObjectIndex
- All Implemented Interfaces:
- Comparator
public class ObjectIndex
- extends Object
- implements Comparator
This is an experimental class aimed at producing an index across a
collection of homogeneous objects. It should be noted here that it is the "sorting"
of the elements in the List of objects that takes nearly all the time here.
Use the sort()
method yourself to only perform sort once. Everytime you
add an object however the sort status of the List of objects will be invalidated and
have to be re-sorted before you have retrieve the objects again.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectIndex
public ObjectIndex(Class c)
isSyncOnAdd
public boolean isSyncOnAdd()
setSyncOnAdd
public void setSyncOnAdd(boolean v)
getObjects
public List getObjects(List keys)
size
public int size()
sort
public void sort()
add
public void add(String name)
removeObject
public void removeObject(Object o)
addObject
public void addObject(Object o)
compare
public int compare(Object o,
List keys)
compare
public int compare(Object o1,
Object o2)
- Specified by:
compare
in interface Comparator
Copyright © 2008 Gary Bentley. All Rights Reserved.