@Override public String toString() { String s = "{version=" + getVersion() + ","; s += "acceptVersions={" + ArrayUtils.join( ",", acceptVersions ) + "},"; s += "sections={" + ArrayUtils.join( ",", sections ) + "},"; s += "acceptFormats={" + ArrayUtils.join( ",", acceptFormats ) + "},"; s += "updateSequence={" + updateSequence + "},"; s += "acceptLanguages={" + ArrayUtils.join( ",", acceptLanguages ) + "}"; s += "}"; return s; } }
@Override public void update( Stroke obj, String val ) { // , is not strictly allowed, but we don't lose anything by being flexible if ( val.contains( "," ) ) { obj.dasharray = splitAsDoubles( val, "," ); } else { obj.dasharray = splitAsDoubles( val, "\\s" ); } } }, contn ).second;
/** * Checks if the array contains the string <code>value</code>. This method is case insensitive. * * @param target * array to check if it contains <code>value</code> * @param value * string to check if it within the array * @return true if passed array contains value */ public static boolean contains( String[] target, String value ) { return contains( target, value, false, true ); }
kw = deleteDoubles( kw );
/** * Creates a new {@link IdAnalyzer} instance for the given {@link MappedAppSchema}. * * @param schema application schema with mapping information, must not be <code>null</code> */ public IdAnalyzer( MappedAppSchema schema ) { this.schema = schema; for ( FeatureType ft : schema.getFeatureTypes() ) { if ( !ft.isAbstract() ) { FeatureTypeMapping ftMapping = schema.getFtMapping( ft.getName() ); if ( ftMapping != null ) { FIDMapping fidMapping = ftMapping.getFidMapping(); if ( fidMapping != null ) { LOG.debug( fidMapping.getPrefix() + " -> " + ft.getName() ); prefixToFt.put( fidMapping.getPrefix(), ft ); } } } } prefixKeysSortedByLengthDesc = prefixToFt.keySet().toArray( new String[0] ); sortByLengthDescending( prefixKeysSortedByLengthDesc ); }
/** * Joins a list of strings with given delimiter. * * @param delimiter * the delimiter to put between every string. * @param strings * @return the joined string */ public static String join( String delimiter, String... strings ) { // call join method for list // Arrays.asList is cheap and only creates a wrapper return join( delimiter, Arrays.asList( strings ) ); }
/** * @param optionValue * @return */ private static double[] createTranslationVector( String optionValue, int size ) { double[] result = new double[size]; if ( optionValue != null && !"".equals( optionValue ) ) { try { result = ArrayUtils.splitAsDoubles( optionValue, "," ); if ( result.length != size ) { throw new NumberFormatException( "Illigal number of values, only two dimensional translations are allowed" ); } } catch ( NumberFormatException e ) { System.err.println( "Translation vector " + optionValue + " could not be read, please make sure it is a comma seperated list of (floating point) numbers: " + e.getLocalizedMessage() ); } } return result; }
/** * * @param id * @param caseSensitive * @param exact * @return true if the given id is present in this objects id's. */ public boolean hasId( String id, boolean caseSensitive, boolean exact ) { return contains( getOrignalCodeStrings(), id, caseSensitive, exact ); }
/** * Joins a list of objects with given delimiter. * * @param delimiter * the delimiter to put between every string. * @param objects * @return the joined string */ public static String join( String delimiter, Object... objects ) { // call join method for list // Arrays.asList is cheap and only creates a wrapper return join( delimiter, Arrays.asList( objects ) ); }
/** * @param optionValue * @return */ private static double[] createTranslationVector( String optionValue ) { double[] result = new double[2]; if ( optionValue != null && !"".equals( optionValue ) ) { try { result = ArrayUtils.splitAsDoubles( optionValue, "," ); if ( result.length != 2 ) { throw new NumberFormatException( "Illigal number of values, only two dimensional translations are allowed" ); } } catch ( NumberFormatException e ) { System.err.println( "Translation vector " + optionValue + " could not be read, please make sure it is a comma seperated list of (floating point) numbers: " + e.getLocalizedMessage() ); } } return result; }
/** * Iterates over all Ids (code type originals) and Names and tests if either one matches the given string. * * @param idOrName * a String which might be an id or a name. * @param caseSensitive * should the match me case sensitive * @param exact * should the names and ids contain the given string or match exact. * @return true if any of the names or codes match without case the given string. */ public boolean hasIdOrName( String idOrName, boolean caseSensitive, boolean exact ) { return ArrayUtils.contains( getOrignalCodeStrings(), idOrName, caseSensitive, exact ) || ArrayUtils.contains( getNames(), idOrName, caseSensitive, exact ); }
private static void exportGMLPos( XMLStreamWriter writer, double... values ) throws XMLStreamException { writer.writeStartElement( GML_NS, "pos" ); writer.writeNamespace( GML_PREFIX, GML_NS ); writer.writeAttribute( "dimension", Integer.toString( values.length ) ); writer.writeCharacters( ArrayUtils.join( " ", values ) ); writer.writeEndElement(); // pos }
/** * @param optionValue * @return */ private static double[] createTranslationVector( String optionValue, int size ) { double[] result = new double[size]; if ( optionValue != null && !"".equals( optionValue ) ) { try { result = ArrayUtils.splitAsDoubles( optionValue, "," ); if ( result.length != size ) { throw new NumberFormatException( "Illigal number of values, only two dimensional translations are allowed" ); } } catch ( NumberFormatException e ) { System.err.println( "Translation vector " + optionValue + " could not be read, please make sure it is a comma seperated list of (floating point) numbers: " + e.getLocalizedMessage() ); } } return result; }
if ( !ArrayUtils.contains( profile.getSupportedServiceNames(), serviceAttr ) ) { StringBuilder sb = new StringBuilder(); sb.append( "Wrong service attribute: '" ).append( serviceAttr );
/** * Return a String with all element names of the given enum class. * * @param enumClass * @param map * the operator type -> element name map * @return a coma separated list of element names */ private static String elemNames( Class<? extends Enum<?>> enumClass, Map<? extends Enum<?>, QName> map ) { List<String> names = new LinkedList<String>(); for ( Enum<?> e : enumClass.getEnumConstants() ) { QName qname = map.get( e ); if ( qname != null ) { LOG.debug( qname.toString() ); names.add( qname.toString() ); } } return ArrayUtils.join( ", ", names ); } }
return; double[] ds = splitAsDoubles( map.get( "BBOX" ), "," ); Envelope newBox = fac.createEnvelope( ds[0], ds[1], ds[2], ds[3], CRSManager.getCRSRef( map.get( "SRS" ) ) );
/** * Return a String with all element names of the given enum class. * * @param enumClass * @param map * the operator type -> element name map * @return a coma separated list of element names */ private static String elemNames( Class<? extends Enum<?>> enumClass, Map<? extends Enum<?>, QName> map ) { List<String> names = new LinkedList<String>(); for ( Enum<?> e : enumClass.getEnumConstants() ) { QName qname = map.get( e ); if ( qname == null ) { LOG.warn( "No value for " + e ); } else { names.add( qname.toString() ); } } return ArrayUtils.join( ", ", names ); } }
String s = qstring.substring( 5 ); s = URLDecoder.decode( s, "UTF-8" ); double[] ds = ArrayUtils.splitAsDoubles( s, "," ); if ( ds.length != 4 ) { resp.setStatus( 404 );
/** * Return a String with all element names of the given enum class. * * @param enumClass * @param map * the operator type -> element name map * @return a coma separated list of element names */ private static String elemNames( Class<? extends Enum<?>> enumClass, Map<? extends Enum<?>, QName> map ) { List<String> names = new LinkedList<String>(); for ( Enum<?> e : enumClass.getEnumConstants() ) { QName qname = map.get( e ); if ( qname != null ) { LOG.debug( qname.toString() ); names.add( qname.toString() ); } } return ArrayUtils.join( ", ", names ); } }
continue; double[] ds = splitAsDoubles( map.get( "BBOX" ), "," ); Envelope newBox = fac.createEnvelope( ds[0], ds[1], ds[2], ds[3], CRSManager.getCRSRef( map.get( "SRS" ) ) );