@Override public ObjectBigArrayBigList<K> clone() { ObjectBigArrayBigList<K> c = new ObjectBigArrayBigList<>(size); ObjectBigArrays.copy(a, 0, c.a, 0, size); c.size = size; return c; } private boolean valEquals(final K a, final K b) {
/** Returns all lines of the file wrapped by this file-lines collection. * * @return all lines of the file wrapped by this file-lines collection. */ public ObjectBigList<byte[]> allLines() { final ObjectBigList<byte[]> result = new ObjectBigArrayBigList<>(); for(final Iterator<byte[]> i = iterator(); i.hasNext();) result.add(i.next()); return result; }
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; }
/** Returns all lines of the file wrapped by this file-lines collection. * * @return all lines of the file wrapped by this file-lines collection. */ public ObjectBigList<MutableString> allLines() { final ObjectBigList<MutableString> result = new ObjectBigArrayBigList<>(); for(final Iterator<MutableString> i = iterator(); i.hasNext();) result.add(i.next().copy()); return result; }
/** * Wraps a given big array into a big-array list of given size. * * @param a * a big array to wrap. * @param length * the length of the resulting big-array list. * @return a new big-array list of the given size, wrapping the given big array. */ public static <K> ObjectBigArrayBigList<K> wrap(final K a[][], final long length) { if (length > ObjectBigArrays.length(a)) throw new IllegalArgumentException("The specified length (" + length + ") is greater than the array size (" + ObjectBigArrays.length(a) + ")"); final ObjectBigArrayBigList<K> l = new ObjectBigArrayBigList<>(a, false); l.size = length; return l; } /**
directTerms = new ObjectBigArrayBigList<String>(); directTermIds = new Object2LongAVLTreeMap<String>(); directTermIds.defaultReturnValue(-1);
docBlockSize = queryEngine.getDocumentBlockSize(); documentIds = new LongBigArrayBigList(); documentHits = new ObjectBigArrayBigList<List<Binding>>(); if(scorer != null) { documentScores = new DoubleBigArrayBigList();
/** Creates a new TREC collection by parsing the given files. * * @param file an array of file names containing documents in TREC GOV2 format. * @param factory the document factory (usually, a composite one). * @param bufferSize the buffer size. * @param useGzip true iff the files are gzipped. */ public TRECDocumentCollection( String[] file, DocumentFactory factory, int bufferSize, boolean useGzip ) throws IOException { this.file = file; this.factory = factory; this.bufferSize = bufferSize; this.descriptors = new ObjectBigArrayBigList<TRECDocumentDescriptor>(); this.useGzip = useGzip; final ProgressLogger progressLogger = new ProgressLogger( LOGGER ); progressLogger.expectedUpdates = file.length; progressLogger.itemsName = "files"; progressLogger.start( "Parsing " + ( useGzip ? "GZip" : "plain" ) + " files" ); for ( int i = 0; i < file.length; i++ ) { parseContent( i, openFileStream( file[ i ] ) ); progressLogger.update(); } progressLogger.done(); }
/** Creates a new TREC collection by parsing the given files. * * @param file an array of file names containing documents in TREC GOV2 format. * @param factory the document factory (usually, a composite one). * @param bufferSize the buffer size. * @param useGzip true iff the files are gzipped. */ public TRECDocumentCollection( String[] file, DocumentFactory factory, int bufferSize, boolean useGzip ) throws IOException { this.file = file; this.factory = factory; this.bufferSize = bufferSize; this.descriptors = new ObjectBigArrayBigList<TRECDocumentDescriptor>(); this.useGzip = useGzip; final ProgressLogger progressLogger = new ProgressLogger( LOGGER ); progressLogger.expectedUpdates = file.length; progressLogger.itemsName = "files"; progressLogger.start( "Parsing " + ( useGzip ? "GZip" : "plain" ) + " files" ); for ( int i = 0; i < file.length; i++ ) { parseContent( i, openFileStream( file[ i ] ) ); progressLogger.update(); } progressLogger.done(); }