public Item next() throws NoSuchElementException
    {
        if(postingListMemoryMapped!=null && 
                entry >=0 && 
                entry < lexiconSize &&
                currentPos >=0 &&
                currentPos < toPos)
        {
            numOfReads++;
            int o=postingListMemoryMapped.getInt();
            while(currentPos>=postingListIndex[currentScore+1])
                currentScore++;
            int score=currentScore;
            currentPos+=elementSize;
//            System.out.println("Object:"+o+" Score:"+score);
            return new Item(o,score);
        }
        synchronized(this){
//            System.out.println("Releasing lock on posting list "+entry);
            inUse=false;
            this.notify(); //release exclusive access to the posting list
        }
        throw new NoSuchElementException("InvertedFile not Initialized, non valid entry, or no more elements in this posting list");
    }