/** a ReferenceContainer for the Object passed as parameter */
public ReferenceContainer selectReferences(MemoryObject object, boolean forward) throws Exception
{
MemoryReference key = new MemoryReference();
QuickSorter sorter = null;
FileCollection collection = null;
if (forward)
{
key.setReferee(object.getId());
key.setReferred(-1);
collection = engine.references;
sorter = engine.sorter;
} else
{
key.setReferee(-1);
key.setReferred(object.getId());
collection = engine.invertedReferences;
sorter = engine.invertedSorter;
}
ReferenceContainer container = new ReferenceContainer(object);
ArrayList referencesFound = sorter.binarySearchCollection(collection,key);
Iterator iter = referencesFound.iterator();
while (iter.hasNext())
{