public int firstIndexOf(String value) { return values.indexOf(getKeyForValue(value)); }
@Override public boolean rem(final int k) { int index = indexOf(k); if (index == -1) return false; removeInt(index); assert size <= a.length; return true; } @Override
public int firstIndexOf(String value) { return values.indexOf(getKeyForValue(value)); }
/** * Returns true if this column contains a cell with the given string, and false otherwise */ public boolean contains(String aString) { return values.indexOf(dictionaryMap().get(aString)) >= 0; }
/** Adds the given arc. * * @param x the start of the arc. * @param y the end of the arc. */ public void addArc(final int x, final int y) { ensureNode(x); ensureNode(y); if (successors[x].indexOf(y) != -1) throw new IllegalArgumentException("Node " + y + " is already a successor of node " + x); modificationCount++; successors[x].add(y); m++; }
if ( factory.fieldType( field ) != DocumentFactory.FieldType.VIRTUAL ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not virtual" ); try { virtualDocumentGap[ indexedFields.indexOf( field ) ] = Integer.parseInt( virtualDocumentGapSpec[ i ].substring( split + 1 ) ); if ( virtualDocumentGap[ indexedFields.indexOf( field ) ] < 0 ) throw new NumberFormatException( "Gap can't be negative" );
/** Removes the given arc. * * @param x the start of the arc. * @param y the end of the arc. */ public void removeArc(final int x, final int y) { ensureNode(x); ensureNode(y); final int pos = successors[x].indexOf(y); if (pos == -1) throw new IllegalArgumentException("Node " + y + " is not a successor of node " + x); modificationCount++; successors[x].removeInt(pos); m--; }
if ( factory.fieldType( field ) != DocumentFactory.FieldType.VIRTUAL ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not virtual" ); try { virtualDocumentGap[ indexedFields.indexOf( field ) ] = Integer.parseInt( virtualDocumentGapSpec[ i ].substring( split + 1 ) ); if ( virtualDocumentGap[ indexedFields.indexOf( field ) ] < 0 ) throw new NumberFormatException( "Gap can't be negative" );
if ( factory.fieldType( field ) != DocumentFactory.FieldType.VIRTUAL ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not virtual" ); try { virtualDocumentGap[ indexedFields.indexOf( field ) ] = Integer.parseInt( virtualDocumentGapSpec[ i ].substring( split + 1 ) ); if ( virtualDocumentGap[ indexedFields.indexOf( field ) ] < 0 ) throw new NumberFormatException( "Gap can't be negative" );
if ( factory.fieldType( field ) != DocumentFactory.FieldType.VIRTUAL ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not virtual" ); try { virtualDocumentGap[ indexedFields.indexOf( field ) ] = Integer.parseInt( virtualDocumentGapSpec[ i ].substring( split + 1 ) ); if ( virtualDocumentGap[ indexedFields.indexOf( field ) ] < 0 ) throw new NumberFormatException( "Gap can't be negative" );
public static int[] parseQualifiedSizes( final String[] qualifiedSizes, final String defaultSize, final int[] indexedField, final DocumentFactory factory ) throws ParseException { final int[] size = new int[ indexedField.length ]; String defaultSpec = defaultSize; IntArrayList indexedFields = IntArrayList.wrap( indexedField ); for ( int i = 0; i < qualifiedSizes.length; i++ ) if ( qualifiedSizes[ i ].indexOf( ':' ) == -1 ) defaultSpec = qualifiedSizes[ i ]; for ( int i = 0; i < size.length; i++ ) size[ i ] = (int)LongSizeStringParser.parseSize( defaultSpec ); for ( int i = 0; i < qualifiedSizes.length; i++ ) { final int split = qualifiedSizes[ i ].indexOf( ':' ); if ( split >= 0 ) { final String fieldName = qualifiedSizes[ i ].substring( 0, split ); final int field = factory.fieldIndex( fieldName ); if ( field < 0 ) throw new IllegalArgumentException( "Field " + fieldName + " is not part of factory " + factory.getClass().getName() ); if ( !indexedFields.contains( field ) ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not being indexed" ); size[ indexedFields.indexOf( field ) ] = (int)LongSizeStringParser.parseSize( qualifiedSizes[ i ].substring( split + 1 ) ); } } return size; }
public static int[] parseQualifiedSizes( final String[] qualifiedSizes, final String defaultSize, final int[] indexedField, final DocumentFactory factory ) throws ParseException { final int[] size = new int[ indexedField.length ]; String defaultSpec = defaultSize; IntArrayList indexedFields = IntArrayList.wrap( indexedField ); for ( int i = 0; i < qualifiedSizes.length; i++ ) if ( qualifiedSizes[ i ].indexOf( ':' ) == -1 ) defaultSpec = qualifiedSizes[ i ]; for ( int i = 0; i < size.length; i++ ) size[ i ] = (int)LongSizeStringParser.parseSize( defaultSpec ); for ( int i = 0; i < qualifiedSizes.length; i++ ) { final int split = qualifiedSizes[ i ].indexOf( ':' ); if ( split >= 0 ) { final String fieldName = qualifiedSizes[ i ].substring( 0, split ); final int field = factory.fieldIndex( fieldName ); if ( field < 0 ) throw new IllegalArgumentException( "Field " + fieldName + " is not part of factory " + factory.getClass().getName() ); if ( !indexedFields.contains( field ) ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not being indexed" ); size[ indexedFields.indexOf( field ) ] = (int)LongSizeStringParser.parseSize( qualifiedSizes[ i ].substring( split + 1 ) ); } } return size; }
public static int[] parseQualifiedSizes( final String[] qualifiedSizes, final String defaultSize, final int[] indexedField, final DocumentFactory factory ) throws ParseException { final int[] size = new int[ indexedField.length ]; String defaultSpec = defaultSize; IntArrayList indexedFields = IntArrayList.wrap( indexedField ); for ( int i = 0; i < qualifiedSizes.length; i++ ) if ( qualifiedSizes[ i ].indexOf( ':' ) == -1 ) defaultSpec = qualifiedSizes[ i ]; for ( int i = 0; i < size.length; i++ ) size[ i ] = (int)LongSizeStringParser.parseSize( defaultSpec ); for ( int i = 0; i < qualifiedSizes.length; i++ ) { final int split = qualifiedSizes[ i ].indexOf( ':' ); if ( split >= 0 ) { final String fieldName = qualifiedSizes[ i ].substring( 0, split ); final int field = factory.fieldIndex( fieldName ); if ( field < 0 ) throw new IllegalArgumentException( "Field " + fieldName + " is not part of factory " + factory.getClass().getName() ); if ( !indexedFields.contains( field ) ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not being indexed" ); size[ indexedFields.indexOf( field ) ] = (int)LongSizeStringParser.parseSize( qualifiedSizes[ i ].substring( split + 1 ) ); } } return size; }
public static int[] parseQualifiedSizes( final String[] qualifiedSizes, final String defaultSize, final int[] indexedField, final DocumentFactory factory ) throws ParseException { final int[] size = new int[ indexedField.length ]; String defaultSpec = defaultSize; IntArrayList indexedFields = IntArrayList.wrap( indexedField ); for ( int i = 0; i < qualifiedSizes.length; i++ ) if ( qualifiedSizes[ i ].indexOf( ':' ) == -1 ) defaultSpec = qualifiedSizes[ i ]; for ( int i = 0; i < size.length; i++ ) size[ i ] = (int)LongSizeStringParser.parseSize( defaultSpec ); for ( int i = 0; i < qualifiedSizes.length; i++ ) { final int split = qualifiedSizes[ i ].indexOf( ':' ); if ( split >= 0 ) { final String fieldName = qualifiedSizes[ i ].substring( 0, split ); final int field = factory.fieldIndex( fieldName ); if ( field < 0 ) throw new IllegalArgumentException( "Field " + fieldName + " is not part of factory " + factory.getClass().getName() ); if ( !indexedFields.contains( field ) ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not being indexed" ); size[ indexedFields.indexOf( field ) ] = (int)LongSizeStringParser.parseSize( qualifiedSizes[ i ].substring( split + 1 ) ); } } return size; }
if ( factory.fieldType( field ) != DocumentFactory.FieldType.VIRTUAL ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not virtual" ); try { virtualDocumentResolver[ indexedFields.indexOf( field ) ] = (VirtualDocumentResolver)BinIO.loadObject( virtualDocumentSpec[ i ].substring( split + 1 ) );
if ( factory.fieldType( field ) != DocumentFactory.FieldType.VIRTUAL ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not virtual" ); try { virtualDocumentResolver[ indexedFields.indexOf( field ) ] = (VirtualDocumentResolver)BinIO.loadObject( virtualDocumentSpec[ i ].substring( split + 1 ) );
if ( factory.fieldType( field ) != DocumentFactory.FieldType.VIRTUAL ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not virtual" ); try { virtualDocumentResolver[ indexedFields.indexOf( field ) ] = (VirtualDocumentResolver)IOFactories.loadObject( ioFactory,virtualDocumentSpec[ i ].substring( split + 1 ) );
if ( factory.fieldType( field ) != DocumentFactory.FieldType.VIRTUAL ) throw new IllegalArgumentException( "Field " + factory.fieldName( field ) + " is not virtual" ); try { virtualDocumentResolver[ indexedFields.indexOf( field ) ] = (VirtualDocumentResolver)IOFactories.loadObject( ioFactory,virtualDocumentSpec[ i ].substring( split + 1 ) );
else if ( index[ i ].hasPositions ) { occ[ i ] = IndexIterators.positionArray( indexIterator ); if ( IntArrayList.wrap( occ[ i ], indexIterator.count() ).indexOf( pos ) == -1 ) LOGGER.error( index[ i ] + ": Position " + pos + " does not appear in the position list of term " + word + " in document " + currDoc );
else if ( index[ i ].hasPositions ) { occ[ i ] = IndexIterators.positionArray( indexIterator ); if ( IntArrayList.wrap( occ[ i ], indexIterator.count() ).indexOf( pos ) == -1 ) LOGGER.error( index[ i ] + ": Position " + pos + " does not appear in the position list of term " + word + " in document " + currDoc );