public String[] getStringArray( final Enum<?> key ) { return getStringArray( key.name().toLowerCase() ); }
public String[] getStringArray(final Enum<?> key) { return getStringArray(key.name().toLowerCase()); }
public String[] getStringArray( final Enum<?> key ) { return getStringArray( key.name().toLowerCase() ); }
public int hashCode() { int h = 0; for( Iterator<?> i = getKeys(); i.hasNext(); ) h = h * 31 + Arrays.hashCode( getStringArray( (String)i.next() ) ); return h; }
@Override public int hashCode() { int h = 0; for(Iterator<?> i = getKeys(); i.hasNext();) h = h * 31 + Arrays.hashCode(getStringArray((String)i.next())); return h; }
public int hashCode() { int h = 0; for( Iterator<?> i = getKeys(); i.hasNext(); ) h = h * 31 + Arrays.hashCode( getStringArray( (String)i.next() ) ); return h; }
/** Returns true if the provided object is equal to this set of properties. * * <p>Equality between set of properties happens when the keys are the same, * and the list of strings associated to each key is the same. Note that the order * in which different keys appear in a property file is irrelevant, but <em>the order * between properties with the same key is significant</em>. * * <p>Due to the strictness of the check (e.g., no number conversion is performed) * this method is mainly useful when writing tests. * * @return true if the argument is equal to this set of properties. */ public boolean equals( final Object o ) { if ( ! ( o instanceof Properties ) ) return false; final Properties p = (Properties)o; for( Iterator<?> i = getKeys(); i.hasNext(); ) { String key = (String)i.next(); String[] value = p.getStringArray( key ); if ( value == null || ! Arrays.equals( getStringArray( key ), value ) ) return false; } for( Iterator<?> i = p.getKeys(); i.hasNext(); ) if ( getStringArray( (String)i.next() ) == null ) return false; return true; }
/** Returns true if the provided object is equal to this set of properties. * * <p>Equality between set of properties happens when the keys are the same, * and the list of strings associated to each key is the same. Note that the order * in which different keys appear in a property file is irrelevant, but <em>the order * between properties with the same key is significant</em>. * * <p>Due to the strictness of the check (e.g., no number conversion is performed) * this method is mainly useful when writing tests. * * @return true if the argument is equal to this set of properties. */ public boolean equals( final Object o ) { if ( ! ( o instanceof Properties ) ) return false; final Properties p = (Properties)o; for( Iterator<?> i = getKeys(); i.hasNext(); ) { String key = (String)i.next(); String[] value = p.getStringArray( key ); if ( value == null || ! Arrays.equals( getStringArray( key ), value ) ) return false; } for( Iterator<?> i = p.getKeys(); i.hasNext(); ) if ( getStringArray( (String)i.next() ) == null ) return false; return true; }
/** Returns true if the provided object is equal to this set of properties. * * <p>Equality between set of properties happens when the keys are the same, * and the list of strings associated with each key is the same. Note that the order * in which different keys appear in a property file is irrelevant, but <em>the order * between properties with the same key is significant</em>. * * <p>Due to the strictness of the check (e.g., no number conversion is performed) * this method is mainly useful when writing tests. * * @return true if the argument is equal to this set of properties. */ @Override public boolean equals(final Object o) { if (! (o instanceof Properties)) return false; final Properties p = (Properties)o; for(Iterator<?> i = getKeys(); i.hasNext();) { String key = (String)i.next(); String[] value = p.getStringArray(key); if (value == null || ! Arrays.equals(getStringArray(key), value)) return false; } for(Iterator<?> i = p.getKeys(); i.hasNext();) if (getStringArray((String)i.next()) == null) return false; return true; }
/** Scans the property set, parsing the properties that concern this class. * * @param properties a set of properties. * @return a metadata map. */ @SuppressWarnings("unchecked") public Reference2ObjectMap<Enum<?>,Object> parseProperties( final Properties properties ) throws ConfigurationException { String key, qualifier, className = this.getClass().getName(); int lastDot; Reference2ObjectArrayMap<Enum<?>,Object> metadata = new Reference2ObjectArrayMap<Enum<?>,Object>(); for( Iterator<?> i = properties.getKeys(); i.hasNext(); ) { key = i.next().toString(); lastDot = key.lastIndexOf( '.' ); qualifier = lastDot == -1 ? "" : key.substring( 0, lastDot ); if ( className.startsWith( qualifier ) && ! parseProperty( key.substring( lastDot + 1 ), properties.getStringArray( key ), metadata ) && className.equals( qualifier ) ) throw new ConfigurationException( "Unknown property " + key ); } return metadata.isEmpty() ? Reference2ObjectMaps.EMPTY_MAP : metadata; }
/** Scans the property set, parsing the properties that concern this class. * * @param properties a set of properties. * @return a metadata map. */ @SuppressWarnings("unchecked") public Reference2ObjectMap<Enum<?>,Object> parseProperties( final Properties properties ) throws ConfigurationException { String key, qualifier, className = this.getClass().getName(); int lastDot; Reference2ObjectArrayMap<Enum<?>,Object> metadata = new Reference2ObjectArrayMap<Enum<?>,Object>(); for( Iterator<?> i = properties.getKeys(); i.hasNext(); ) { key = i.next().toString(); lastDot = key.lastIndexOf( '.' ); qualifier = lastDot == -1 ? "" : key.substring( 0, lastDot ); if ( className.startsWith( qualifier ) && ! parseProperty( key.substring( lastDot + 1 ), properties.getStringArray( key ), metadata ) && className.equals( qualifier ) ) throw new ConfigurationException( "Unknown property " + key ); } return metadata.isEmpty() ? Reference2ObjectMaps.EMPTY_MAP : metadata; }
/** Scans the property set, parsing the properties that concern this class. * * @param properties a set of properties. * @return a metadata map. */ @SuppressWarnings("unchecked") public Reference2ObjectMap<Enum<?>,Object> parseProperties( final Properties properties ) throws ConfigurationException { String key, qualifier, className = this.getClass().getName(); int lastDot; Reference2ObjectArrayMap<Enum<?>,Object> metadata = new Reference2ObjectArrayMap<Enum<?>,Object>(); for( Iterator<?> i = properties.getKeys(); i.hasNext(); ) { key = i.next().toString(); lastDot = key.lastIndexOf( '.' ); qualifier = lastDot == -1 ? "" : key.substring( 0, lastDot ); if ( className.startsWith( qualifier ) && ! parseProperty( key.substring( lastDot + 1 ), properties.getStringArray( key ), metadata ) && className.equals( qualifier ) ) throw new ConfigurationException( "Unknown property " + key ); } return metadata.isEmpty() ? Reference2ObjectMaps.EMPTY_MAP : metadata; }
/** Scans the property set, parsing the properties that concern this class. * * @param properties a set of properties. * @return a metadata map. */ @SuppressWarnings("unchecked") public Reference2ObjectMap<Enum<?>,Object> parseProperties( final Properties properties ) throws ConfigurationException { String key, qualifier, className = this.getClass().getName(); int lastDot; Reference2ObjectArrayMap<Enum<?>,Object> metadata = new Reference2ObjectArrayMap<Enum<?>,Object>(); for( Iterator<?> i = properties.getKeys(); i.hasNext(); ) { key = i.next().toString(); lastDot = key.lastIndexOf( '.' ); qualifier = lastDot == -1 ? "" : key.substring( 0, lastDot ); if ( className.startsWith( qualifier ) && ! parseProperty( key.substring( lastDot + 1 ), properties.getStringArray( key ), metadata ) && className.equals( qualifier ) ) throw new ConfigurationException( "Unknown property " + key ); } return metadata.isEmpty() ? Reference2ObjectMaps.EMPTY_MAP : metadata; }
final String[] inputBasename = new Properties( new File( batchDir, basenameField[ i ] ) + Scan.CLUSTER_PROPERTIES_EXTENSION ).getStringArray( IndexCluster.PropertyKeys.LOCALINDEX ); batches = inputBasename.length; if ( factory.fieldType( indexedField[ i ] ) == DocumentFactory.FieldType.TEXT ) {
final String[] inputBasename = IOFactories.loadProperties( ioFactory, basenameField[ i ] + Scan.CLUSTER_PROPERTIES_EXTENSION ).getStringArray( IndexCluster.PropertyKeys.LOCALINDEX );
final String[] inputBasename = IOFactories.loadProperties( ioFactory, basenameField[ i ] + Scan.CLUSTER_PROPERTIES_EXTENSION ).getStringArray( IndexCluster.PropertyKeys.LOCALINDEX ); batches = inputBasename.length; if ( factory.fieldType( indexedField[ i ] ) == DocumentFactory.FieldType.TEXT || factory.fieldType( indexedField[ i ] ) == DocumentFactory.FieldType.TOKEN ) {
final String[] inputBasename = new Properties( basenameField[ i ] + Scan.CLUSTER_PROPERTIES_EXTENSION ).getStringArray( IndexCluster.PropertyKeys.LOCALINDEX ); batches = inputBasename.length; if ( factory.fieldType( indexedField[ i ] ) == DocumentFactory.FieldType.TEXT ) {
if ( jsapResult.getBoolean( "properties" ) ) { if ( jsapResult.getStringArray( "inputBasename" ).length > 1 ) throw new IllegalArgumentException( "When using --properties, you must specify exactly one inputBasename" ); inputBasename = new Properties( jsapResult.getStringArray( "inputBasename" )[ 0 ] + Scan.CLUSTER_PROPERTIES_EXTENSION ).getStringArray( IndexCluster.PropertyKeys.LOCALINDEX );
if ( jsapResult.getBoolean( "properties" ) ) { if ( jsapResult.getStringArray( "inputBasename" ).length > 1 ) throw new IllegalArgumentException( "When using --properties, you must specify exactly one inputBasename" ); inputBasename = new Properties( jsapResult.getStringArray( "inputBasename" )[ 0 ] + Scan.CLUSTER_PROPERTIES_EXTENSION ).getStringArray( IndexCluster.PropertyKeys.LOCALINDEX );
if ( jsapResult.getBoolean( "properties" ) ) { if ( jsapResult.getStringArray( "inputBasename" ).length > 1 ) throw new IllegalArgumentException( "When using --properties, you must specify exactly one inputBasename" ); inputBasename = new Properties( jsapResult.getStringArray( "inputBasename" )[ 0 ] + Scan.CLUSTER_PROPERTIES_EXTENSION ).getStringArray( IndexCluster.PropertyKeys.LOCALINDEX );