org.josql.incubator
Class ObjectIndex

java.lang.Object
  extended by 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.


Constructor Summary
ObjectIndex(Class c)
           
 
Method Summary
 void add(String name)
           
 void addObject(Object o)
           
 int compare(Object o, List keys)
           
 int compare(Object o1, Object o2)
           
 List getObjects(List keys)
           
 boolean isSyncOnAdd()
           
 void removeObject(Object o)
           
 void setSyncOnAdd(boolean v)
           
 int size()
           
 void sort()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ObjectIndex

public ObjectIndex(Class c)
Method Detail

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.