(Prop<? extends Number> n, float def)
| 471 | } |
| 472 | |
| 473 | public float getFloat(Prop<? extends Number> n, float def) { |
| 474 | Object x = get(n); |
| 475 | if (x instanceof Float[]) return ((Float[]) x)[0].floatValue(); |
| 476 | if (x instanceof Boolean) return ((Boolean) x).booleanValue() ? 1 : 0f; |
| 477 | if (x instanceof float[]) return ((float[]) x)[0]; |
| 478 | |
| 479 | Number gotten = (Number) x; |
| 480 | if (gotten != null) return gotten.floatValue(); |
| 481 | return def; |
| 482 | } |
| 483 | |
| 484 | |
| 485 | public Dict duplicate() { |
no test coverage detected