public UnsortedInputIterator(InputIterator source) throws IOException {
  super(source);
  ords=new int[entries.size()];
  Random random=new Random();
  for (int i=0; i < ords.length; i++) {
    ords[i]=i;
  }
  for (int i=0; i < ords.length; i++) {
    int randomPosition=random.nextInt(ords.length);
    int temp=ords[i];
    ords[i]=ords[randomPosition];
    ords[randomPosition]=temp;
  }
}

public UnsortedInputIterator ( InputIterator source ) throws IOException { super ( source ) ; ords = new int [ entries . size ( ) ] ; Random random = new Random ( ) ; for ( int i = 0 ; i < ords . length ; i ++ ) { ords [ i ] = i ; } for ( int i = 0 ; i < ords . length ; i ++ ) { int randomPosition = random . nextInt ( ords . length ) ; int temp = ords [ i ] ; ords [ i ] = ords [ randomPosition ] ; ords [ randomPosition ] = temp ; } }
creates a new iterator , wrapping the specified iterator and returning elements in a random order .
