Exemplo n.º 1
0
 public void remove(LeftTuple tuple) {
   LeftTupleList list = tuple.getMemory();
   list.remove(tuple);
   if (list.getFirst() == null) {
     tree.delete(((Node<Comparable<Comparable>>) list).key);
   }
   size--;
 }
Exemplo n.º 2
0
  public Entry[] toArray() {
    FastIterator it = tree.fastIterator();
    if (it == null) {
      return new Entry[0];
    }

    List<Comparable> toBeRemoved = new ArrayList<Comparable>();
    List<LeftTuple> result = new ArrayList<LeftTuple>();

    LeftTupleList list = null;
    while ((list = (LeftTupleList) it.next(list)) != null) {
      LeftTuple entry = list.getFirst();
      while (entry != null) {
        result.add(entry);
        entry = (LeftTuple) entry.getNext();
      }
    }

    return result.toArray(new LeftTuple[result.size()]);
  }
Exemplo n.º 3
0
 public void add(LeftTuple tuple) {
   Comparable key = getIndexedValue(tuple);
   LeftTupleList list = tree.insert(key);
   list.add(tuple);
   size++;
 }