Migliroato positions e agiunto come metodo alla interfaccia position. Fixato alcuni bug. Aggiunto test della prova intercorso del 10/4/14. Bisogna implementare tree

This commit is contained in:
2014-04-10 00:21:49 +02:00
parent 0956f6b92f
commit cafb12ea9f
13 changed files with 499 additions and 90 deletions

View File

@@ -5,6 +5,7 @@ import exceptions.EmptyListException;
import exceptions.EmptySequenceException;
import exceptions.InvalidPositionException;
import iterator.IndexListIterator;
import iterator.IterablePositionIndexList;
import position.Position;
import sequence.utility.ArrayPosition;
@@ -298,4 +299,15 @@ public class ArraySequence<E> implements Sequence<E> {
return new IndexListIterator<E>(temp);
}
@Override
public Iterable<Position<E>> positions() {
Position<E>[] temp = new Position [this.size()];
for (int i = 0 ;i < this.size(); i++){
temp[i] = this.atIndex(i);
}
return new IterablePositionIndexList<E>(temp);
}
}