/** Checks whether the given byte array is in this filter. * * @param a a byte array. * @return true if <code>a</code> is in this filter. * @see #contains(CharSequence) */ public boolean contains(final byte[] a) { return contains(a, BYTE_ARRAY_FUNNEL); }
/** Checks whether an object of generic type is in this filter using the funnel specified at construction time. * * @param e an element. * @return true if <code>e</code> is in this filter. * @see #contains(CharSequence) */ public boolean contains(final T e) { return contains(e, funnel); }
/** Checks whether the given character sequence is in this filter. * * <P>Note that this method may return true on a character sequence that has * never been added to this filter. This will happen with probability 2<sup>-<var>d</var></sup>, * where <var>d</var> is the number of hash functions specified at creation time, if * the number of the elements in this filter is less than <var>n</var>, the number * of expected elements specified at creation time. * * @param s a character sequence. * @return true if <code>s</code> is in this filter. */ public boolean contains(final CharSequence s) { return contains(s, STRING_FUNNEL); }
/** Adds an integer is in this filter. * * @param x an integer. * @return true if <code>x</code> is in this filter. * @see #contains(CharSequence) */ public boolean contains(final int x) { return contains(Integer.valueOf(x), INTEGER_FUNNEL); }
/** Checks whether the given character array is in this filter. * * @param a a character array. * @return true if <code>a</code> is in this filter. * @see #contains(CharSequence) */ public boolean contains(final char[] a) { return contains(new String(a), STRING_FUNNEL); }
/** Checks whether the given long is in this filter. * * @param x a long. * @return true if <code>x</code> is in this filter. * @see #contains(CharSequence) */ public boolean contains(final long x) { return contains(Long.valueOf(x), LONG_FUNNEL); }
public int localIndex( final CharSequence term ) { for( int i = 0; i < termMap.length; i++ ) if ( ( termFilter == null || termFilter[ i ].contains( term ) ) && termMap[ i ].getLong( term ) != -1 ) return i; return -1; }
public int localIndex( final CharSequence term ) { for( int i = 0; i < termMap.length; i++ ) if ( ( termFilter == null || termFilter[ i ].contains( term ) ) && termMap[ i ].getLong( term ) != -1 ) return i; return -1; }
public int localIndex( final CharSequence term ) { for( int i = 0; i < termMap.length; i++ ) if ( ( termFilter == null || termFilter[ i ].contains( term ) ) && termMap[ i ].getLong( term ) != -1 ) return i; return -1; }
public int localIndex( final CharSequence term ) { for( int i = 0; i < termMap.length; i++ ) if ( ( termFilter == null || termFilter[ i ].contains( term ) ) && termMap[ i ].getLong( term ) != -1 ) return i; return -1; }
public IndexIterator documents( final CharSequence term ) throws IOException { final ArrayList<IndexIterator> iterators = new ArrayList<IndexIterator>( indexReader.length ); final IntArrayList usedIndices = new IntArrayList(); for ( int i = 0; i < indexReader.length; i++ ) { if ( index.termFilter == null || index.termFilter[ i ].contains( term ) ) { IndexIterator it = indexReader[ i ].documents( term ); if ( it.mayHaveNext() ) { iterators.add( it ); usedIndices.add( i ); } } } if ( DEBUG ) LOGGER.debug( "Indices used for " + term + ": " + usedIndices ); if ( iterators.isEmpty() ) return index.getEmptyIndexIterator( term ); final IndexIterator indexIterator = index.concatenated ? new DocumentalConcatenatedClusterIndexIterator( this, iterators.toArray( IndexIterators.EMPTY_ARRAY ), usedIndices.toIntArray() ) : new DocumentalMergedClusterIndexIterator( this, iterators.toArray( IndexIterators.EMPTY_ARRAY ), usedIndices.toIntArray() ) ; indexIterator.term( term ); return indexIterator; } }
public IndexIterator documents( final CharSequence term ) throws IOException { final ArrayList<IndexIterator> iterators = new ArrayList<IndexIterator>( indexReader.length ); final IntArrayList usedIndices = new IntArrayList(); for ( int i = 0; i < indexReader.length; i++ ) { if ( index.termFilter == null || index.termFilter[ i ].contains( term ) ) { IndexIterator it = indexReader[ i ].documents( term ); if ( it.mayHaveNext() ) { iterators.add( it ); usedIndices.add( i ); } } } if ( DEBUG ) LOGGER.debug( "Indices used for " + term + ": " + usedIndices ); if ( iterators.isEmpty() ) return index.getEmptyIndexIterator( term ); final IndexIterator indexIterator = index.concatenated ? new DocumentalConcatenatedClusterIndexIterator( this, iterators.toArray( IndexIterators.EMPTY_ARRAY ), usedIndices.toIntArray() ) : new DocumentalMergedClusterIndexIterator( this, iterators.toArray( IndexIterators.EMPTY_ARRAY ), usedIndices.toIntArray() ) ; indexIterator.term( term ); return indexIterator; } }
public IndexIterator documents( final CharSequence term ) throws IOException { final ArrayList<IndexIterator> iterators = new ArrayList<IndexIterator>( indexReader.length ); final IntArrayList usedIndices = new IntArrayList(); for ( int i = 0; i < indexReader.length; i++ ) { if ( index.termFilter == null || index.termFilter[ i ].contains( term ) ) { IndexIterator it = indexReader[ i ].documents( term ); if ( it.mayHaveNext() ) { iterators.add( it ); usedIndices.add( i ); } } } if ( DEBUG ) LOGGER.debug( "Indices used for " + term + ": " + usedIndices ); if ( iterators.isEmpty() ) return index.getEmptyIndexIterator( term ); final IndexIterator indexIterator = index.concatenated ? new DocumentalConcatenatedClusterIndexIterator( this, iterators.toArray( IndexIterators.EMPTY_ARRAY ), usedIndices.toIntArray() ) : new DocumentalMergedClusterIndexIterator( this, iterators.toArray( IndexIterators.EMPTY_ARRAY ), usedIndices.toIntArray() ) ; indexIterator.term( term ); return indexIterator; } }
public IndexIterator documents( final CharSequence term ) throws IOException { final ArrayList<IndexIterator> iterators = new ArrayList<IndexIterator>( indexReader.length ); final IntArrayList usedIndices = new IntArrayList(); for ( int i = 0; i < indexReader.length; i++ ) { if ( index.termFilter == null || index.termFilter[ i ].contains( term ) ) { IndexIterator it = indexReader[ i ].documents( term ); if ( it.hasNext() ) { iterators.add( it ); usedIndices.add( i ); } } } if ( DEBUG ) LOGGER.debug( "Indices used for " + term + ": " + usedIndices ); if ( iterators.isEmpty() ) return index.getEmptyIndexIterator( term ); final IndexIterator indexIterator = index.concatenated ? new DocumentalConcatenatedClusterIndexIterator( this, iterators.toArray( IndexIterators.EMPTY_ARRAY ), usedIndices.toIntArray() ) : new DocumentalMergedClusterIndexIterator( this, iterators.toArray( IndexIterators.EMPTY_ARRAY ), usedIndices.toIntArray() ) ; indexIterator.term( term ); return indexIterator; } }