950951952953954955956957958959960
int iconAnchorY = 0; if ((value = jsMarker.get("iconAnchorY")) != null) { JSONNumber jsAnchorY; if ((jsAnchorY = value.isNumber()) != null) { iconAnchorY = (int) Math.round(jsAnchorY .doubleValue()); } } // do not create new one if old found (only if we want to
115116117118119120121122123124125
*/ private static Long getJsonLongValue(JSONObject json, String key) { JSONValue value = json.get(key); JSONNumber number = (value == null) ? null : value.isNumber(); if (number != null) { return Math.round(number.doubleValue()); } else { return null; } }
206207208209210211212213214215216
return null; } JSONNumber number = value.isNumber(); if ( null != number ) { return new Double[] { number.doubleValue() }; } JSONArray array = value.isArray(); if ( null != array ) { return new Double[] { array.get( 0 ).isNumber().doubleValue(), array.get( 1 ).isNumber().doubleValue() };
106107108109110111112113114115116
return str.stringValue(); } JSONNumber number = value.isNumber(); if ( number != null ) { return new Double( number.doubleValue() ).toString(); } return null; } /**
186187188189190191192193194195196
} protected Double getDouble( int index ) { JSONNumber num = getNumber( index ); return num == null ? null : new Double( num.doubleValue() ); } protected Integer getInteger( int index ) { JSONNumber num = getNumber( index );
192193194195196197198199200201202
} protected Integer getInteger( int index ) { JSONNumber num = getNumber( index ); return num == null ? null : new Integer( (int) num.doubleValue() ); } protected String getString( int index ) { JSONValue value = get( index );
8788899091929394959697
} protected Double getDouble( String key ) { JSONNumber num = getNumber( key ); return num == null ? null : new Double( num.doubleValue() ); } protected Integer getInteger( String key ) { JSONNumber num = getNumber( key );
93949596979899100101102103
} protected Integer getInteger( String key ) { JSONNumber num = getNumber( key ); return num == null ? null : new Integer( (int) num.doubleValue() ); } protected String getString( String key ) { JSONValue value = get( key );
244245246247248249250251252253254
try { JSONValue v = obj.get(key); if (v != null) { JSONNumber n = v.isNumber(); if (n != null) { return (int) n.doubleValue(); } else { /* * If this isn't a number, then it might be a string * like "5" so we try to parse it as a number. */
307308309310311312313314315316317
try { JSONValue v = obj.get(key); if (v != null) { JSONNumber n = v.isNumber(); if (n != null) { return n.doubleValue(); } else { /* * If this isn't a number, then it might be a string * like "5" so we try to parse it as a number. */