Methods Summary |
---|
public javax.management.ValueExp | apply(javax.management.ObjectName name)Applies the ValueExp on a MBean.
return this;
|
public double | doubleValue()Returns a double numeric value
if (val instanceof Long || val instanceof Integer)
{
return (double)(val.longValue());
}
return val.doubleValue();
|
public boolean | isLong()Returns true is if the numeric value is a long, false otherwise.
return (val instanceof Long || val instanceof Integer);
|
public long | longValue()Returns a long numeric value
if (val instanceof Long || val instanceof Integer)
{
return val.longValue();
}
return (long)(val.doubleValue());
|
private void | readObject(java.io.ObjectInputStream in)Deserializes a {@link NumericValueExp} from an {@link ObjectInputStream}.
if (compat)
{
// Read an object serialized in the old serial form
//
double doubleVal;
long longVal;
boolean isLong;
ObjectInputStream.GetField fields = in.readFields();
doubleVal = fields.get("doubleVal", (double)0);
if (fields.defaulted("doubleVal"))
{
throw new NullPointerException("doubleVal");
}
longVal = fields.get("longVal", (long)0);
if (fields.defaulted("longVal"))
{
throw new NullPointerException("longVal");
}
isLong = fields.get("valIsLong", false);
if (fields.defaulted("valIsLong"))
{
throw new NullPointerException("valIsLong");
}
if (isLong)
{
this.val = new Long(longVal);
}
else
{
this.val = new Double(doubleVal);
}
}
else
{
// Read an object serialized in the new serial form
//
in.defaultReadObject();
}
|
public java.lang.String | toString()Returns the string representing the object
if (val instanceof Long || val instanceof Integer)
{
return String.valueOf(val.longValue());
}
return String.valueOf(val.doubleValue());
|
private void | writeObject(java.io.ObjectOutputStream out)Serializes a {@link NumericValueExp} to an {@link ObjectOutputStream}.
if (compat)
{
// Serializes this instance in the old serial form
//
ObjectOutputStream.PutField fields = out.putFields();
fields.put("doubleVal", doubleValue());
fields.put("longVal", longValue());
fields.put("valIsLong", isLong());
out.writeFields();
}
else
{
// Serializes this instance in the new serial form
//
out.defaultWriteObject();
}
|