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:
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user