@Override public void add(K k) { ObjectBigArrayBigList.this.add(pos++, k); last = -1; } @Override
/** * Creates a new big-array big list and fills it with the elements returned by * an iterator.. * * @param i * an iterator whose returned elements will fill the array list. */ public ObjectBigArrayBigList(final Iterator<? extends K> i) { this(); while (i.hasNext()) this.add((i.next())); } /**
private void readObject( final ObjectInputStream s ) throws IOException, ClassNotFoundException { s.defaultReadObject(); final long size = s.readLong(); final ObjectBigArrayBigList<TRECDocumentDescriptor> descriptors = new ObjectBigArrayBigList<TRECDocumentDescriptor>(); descriptors.ensureCapacity( size ); for ( int i = 0; i < size; i++ ) descriptors.add( new TRECDocumentDescriptor( s.readInt(), s.readLong(), s.readInt(), s.readInt() ) ); this.descriptors = descriptors; }
private void readObject( final ObjectInputStream s ) throws IOException, ClassNotFoundException { s.defaultReadObject(); final long size = s.readLong(); final ObjectBigArrayBigList<TRECDocumentDescriptor> descriptors = new ObjectBigArrayBigList<TRECDocumentDescriptor>(); descriptors.ensureCapacity( size ); for ( int i = 0; i < size; i++ ) descriptors.add( new TRECDocumentDescriptor( s.readInt(), s.readLong(), s.readInt(), s.readInt() ) ); this.descriptors = descriptors; }
/** * Creates a new big-array big list and fills it with the elements returned by a * type-specific iterator.. * * @param i * a type-specific iterator whose returned elements will fill the * array list. */ public ObjectBigArrayBigList(final ObjectIterator<? extends K> i) { this(); while (i.hasNext()) this.add(i.next()); } /**
/** * Creates a new big-array big list and fills it with a given type-specific * collection. * * @param c * a type-specific collection that will be used to fill the array * list. */ public ObjectBigArrayBigList(final ObjectCollection<? extends K> c) { this(c.size()); for (ObjectIterator<? extends K> i = c.iterator(); i.hasNext();) add(i.next()); } /**
/** * Merges a new collection in this one, by rebuilding the gzFile array and * appending the other object one, concatenating the descriptors while * rebuilding all. * <p> * It is supposed that the passed object contains no duplicates for the * local collection. */ public void merge( TRECDocumentCollection other ) { int oldLength = this.file.length; this.file = ObjectArrays.ensureCapacity( this.file, this.file.length + other.file.length ); System.arraycopy( other.file, 0, this.file, oldLength, other.file.length ); ObjectIterator<TRECDocumentDescriptor> iter = other.descriptors.iterator(); while ( iter.hasNext() ) { final TRECDocumentDescriptor tdd = (TRECDocumentDescriptor)iter.next().clone(); tdd.fileIndex += oldLength; this.descriptors.add( tdd ); } }
/** * Merges a new collection in this one, by rebuilding the gzFile array and * appending the other object one, concatenating the descriptors while * rebuilding all. * <p> * It is supposed that the passed object contains no duplicates for the * local collection. */ public void merge( TRECDocumentCollection other ) { int oldLength = this.file.length; this.file = ObjectArrays.ensureCapacity( this.file, this.file.length + other.file.length ); System.arraycopy( other.file, 0, this.file, oldLength, other.file.length ); ObjectIterator<TRECDocumentDescriptor> iter = other.descriptors.iterator(); while ( iter.hasNext() ) { final TRECDocumentDescriptor tdd = (TRECDocumentDescriptor)iter.next().clone(); tdd.fileIndex += oldLength; this.descriptors.add( tdd ); } }
currStop = oldPos; if ( DEBUG ) LOGGER.debug( "Setting markers <" + currStart + "," + currInter + ", " + currStop + ">" ); descriptors.add( new TRECDocumentDescriptor( fileIndex, currStart, currInter, currStop ) ); startedBlock = pastHeader = false;
currStop = oldPos; if ( DEBUG ) LOGGER.debug( "Setting markers <" + currStart + "," + currInter + ", " + currStop + ">" ); descriptors.add( new TRECDocumentDescriptor( fileIndex, currStart, currInter, currStop ) ); startedBlock = pastHeader = false;