Lines Matching refs:value

202                 // Read a value of the appropriate type, and insert into the map.
203 final Object value = parseValue(st, type);
208 if (value.getClass() != oldValue.getClass()) {
213 map.put(propertyName, value);
229 * @return a Boolean, Number subclass, or String representing the value.
257 long value;
259 value = Long.decode(st.sval);
264 // Ensure that the type can hold this value, and return.
268 if (value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) {
271 return new Byte((byte)value);
273 if (value < Short.MIN_VALUE || value > Short.MAX_VALUE) {
276 return new Short((short)value);
278 if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {
281 return new Integer((int)value);
283 if (value < Long.MIN_VALUE || value > Long.MAX_VALUE) {
286 return new Long(value);
298 * Parsing as double and converting to float can change the value
301 double value;
306 value = Double.parseDouble(st.sval);
311 // Ensure that the type can hold this value, and return.
313 // This property is a float; make sure the value fits.
314 double absValue = Math.abs(value);
315 if (absValue != 0.0 && !Double.isInfinite(value) && !Double.isNaN(value)) {
320 return new Float((float)value);
323 return new Double(value);
355 * &lt;type&gt; &lt;property-name&gt; = &lt;value&gt; ;
374 * &lt;value&gt; depends on the type:
379 * whose value does not overflow the type. NOTE: these are
382 * If the type is float, the value must fit in 32 bits.
383 * <li> String: a double-quoted string value, or the word {@code null}.
389 * removing its value and type information, as if it had never been
403 Object value = super.get(key);
404 if (value == NULL_STRING) {
407 return value;
419 TypeException(String property, Object value, String requestedType) {
420 super(property + " has type " + value.getClass().getName() +
426 * Returns the value of a boolean property, or the default if the property
430 * @param def The default value to return if the property is not set
431 * @return the value of the property
435 Object value = super.get(property);
436 if (value == null) {
439 if (value instanceof Boolean) {
440 return ((Boolean)value).booleanValue();
442 throw new TypeException(property, value, "boolean");
446 * Returns the value of a byte property, or the default if the property
450 * @param def The default value to return if the property is not set
451 * @return the value of the property
455 Object value = super.get(property);
456 if (value == null) {
459 if (value instanceof Byte) {
460 return ((Byte)value).byteValue();
462 throw new TypeException(property, value, "byte");
466 * Returns the value of a short property, or the default if the property
470 * @param def The default value to return if the property is not set
471 * @return the value of the property
475 Object value = super.get(property);
476 if (value == null) {
479 if (value instanceof Short) {
480 return ((Short)value).shortValue();
482 throw new TypeException(property, value, "short");
486 * Returns the value of an integer property, or the default if the property
490 * @param def The default value to return if the property is not set
491 * @return the value of the property
495 Object value = super.get(property);
496 if (value == null) {
499 if (value instanceof Integer) {
500 return ((Integer)value).intValue();
502 throw new TypeException(property, value, "int");
506 * Returns the value of a long property, or the default if the property
510 * @param def The default value to return if the property is not set
511 * @return the value of the property
515 Object value = super.get(property);
516 if (value == null) {
519 if (value instanceof Long) {
520 return ((Long)value).longValue();
522 throw new TypeException(property, value, "long");
526 * Returns the value of a float property, or the default if the property
530 * @param def The default value to return if the property is not set
531 * @return the value of the property
535 Object value = super.get(property);
536 if (value == null) {
539 if (value instanceof Float) {
540 return ((Float)value).floatValue();
542 throw new TypeException(property, value, "float");
546 * Returns the value of a double property, or the default if the property
550 * @param def The default value to return if the property is not set
551 * @return the value of the property
555 Object value = super.get(property);
556 if (value == null) {
559 if (value instanceof Double) {
560 return ((Double)value).doubleValue();
562 throw new TypeException(property, value, "double");
566 * Returns the value of a string property, or the default if the property
570 * @param def The default value to return if the property is not set
571 * @return the value of the property
575 Object value = super.get(property);
576 if (value == null) {
579 if (value == NULL_STRING) {
581 } else if (value instanceof String) {
582 return (String)value;
584 throw new TypeException(property, value, "string");
592 * Returns the value of a boolean property, or false
596 * @return the value of the property
604 * Returns the value of a byte property, or 0
608 * @return the value of the property
616 * Returns the value of a short property, or 0
620 * @return the value of the property
628 * Returns the value of an integer property, or 0
632 * @return the value of the property
640 * Returns the value of a long property, or 0
644 * @return the value of the property
652 * Returns the value of a float property, or 0.0
656 * @return the value of the property
664 * Returns the value of a double property, or 0.0
668 * @return the value of the property
676 * Returns the value of a String property, or ""
680 * @return the value of the property
699 * STRING_NOT_SET if the property is not set (no type or value).
703 Object value = super.get(property);
704 if (value == null) {
707 if (value == NULL_STRING) {
709 } else if (value instanceof String) {