01: /**
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */package com.tc.util;
04:
05: /**
06: * A thin wrapper around SettableValue to help with boxing/unboxing int's
07: */
08: public class SettableIntValue extends SettableValue {
09:
10: public SettableIntValue() {
11: super ();
12: }
13:
14: public void setInt(int value) {
15: super .set(new Integer(value));
16: }
17:
18: public int intValue() {
19: return intValue(0);
20: }
21:
22: public int intValue(int defaultValue) {
23: if (isSet()) {
24: Integer i = (Integer) value();
25: return i.intValue();
26: } else {
27: return defaultValue;
28: }
29: }
30:
31: public Object clone() {
32: SettableIntValue out = new SettableIntValue();
33: if (this.isSet())
34: out.set(this.value());
35: return out;
36: }
37: }
|