| |
|
| java.lang.Object javax.media.jai.remote.NegotiableNumeric
NegotiableNumeric | public class NegotiableNumeric implements Negotiable(Code) | | A class that wraps a numeric primitive data type or a subclass of
Number to implement the Negotiable interface.
NegotiableNumeric is a convenience class to specify a
Negotiable value for a parameter which has a single
valid numeric value.
since: JAI 1.1 |
NegotiableNumeric | public NegotiableNumeric(byte b)(Code) | | Creates a NegotiableNumeric given a byte .
Parameters: b - The byte to be wrapped to implement Negotiable . |
NegotiableNumeric | public NegotiableNumeric(short s)(Code) | | Creates a NegotiableNumeric given a short .
Parameters: s - The short to be wrapped to implement Negotiable . |
NegotiableNumeric | public NegotiableNumeric(int i)(Code) | | Creates a NegotiableNumeric given an int .
Parameters: i - The int to be wrapped to implement Negotiable . |
NegotiableNumeric | public NegotiableNumeric(long l)(Code) | | Creates a NegotiableNumeric given a long .
Parameters: l - The long to be wrapped to implement Negotiable . |
NegotiableNumeric | public NegotiableNumeric(float f)(Code) | | Creates a NegotiableNumeric given a float .
Parameters: f - The float to be wrapped to implement Negotiable . |
NegotiableNumeric | public NegotiableNumeric(double d)(Code) | | Creates a NegotiableNumeric given a double .
Parameters: d - The double to be wrapped to implement Negotiable . |
NegotiableNumeric | public NegotiableNumeric(Number n)(Code) | | Creates a NegotiableNumeric given a Number .
Parameters: n - The Number to be wrapped to implement Negotiable . throws: IllegalArgumentException - if n is null. |
getNegotiatedValue | public Object getNegotiatedValue()(Code) | | Returns the result of the negotiation as a Number
subclass. Values belonging to a base type, such as int ,
will be returned as a member of the corresponding Number
subclass, such as Integer .
|
getNegotiatedValueAsByte | public byte getNegotiatedValueAsByte()(Code) | | A convenience method to return the single negotiated value as a
byte .
throws: ClassCastException - if the value is of a different Class type. |
getNegotiatedValueAsDouble | public double getNegotiatedValueAsDouble()(Code) | | A convenience method to return the single negotiated value as a
double .
throws: ClassCastException - if the value is of a different Class type. |
getNegotiatedValueAsFloat | public float getNegotiatedValueAsFloat()(Code) | | A convenience method to return the single negotiated value as a
float .
throws: ClassCastException - if the value is of a different Class type. |
getNegotiatedValueAsInt | public int getNegotiatedValueAsInt()(Code) | | A convenience method to return the single negotiated value as a
int .
throws: ClassCastException - if the value is of a different Class type. |
getNegotiatedValueAsLong | public long getNegotiatedValueAsLong()(Code) | | A convenience method to return the single negotiated value as a
long .
throws: ClassCastException - if the value is of a different Class type. |
getNegotiatedValueAsShort | public short getNegotiatedValueAsShort()(Code) | | A convenience method to return the single negotiated value as a
short .
throws: ClassCastException - if the value is of a different Class type. |
getNegotiatedValueClass | public Class getNegotiatedValueClass()(Code) | | Returns the Class of the negotiated value. Values
belonging to a base type, such as int , will be returned
as a member of the corresponding Number subclass, such as
Integer . The Class returned similarly will be
a Number subclass.
|
getNumber | public Number getNumber()(Code) | | Returns the Number that is currently the valid value
for this class. A valid primitive data type value, such as int,
will be returned as a member of the corresponding wrapper class,
such as Integer .
|
negotiate | public Negotiable negotiate(Negotiable other)(Code) | | Returns a NegotiableNumeric that contains the value
that is common to this NegotiableNumeric
and the one supplied, i.e the Number encapsulated in
both the NegotiableNumeric are equal. If the supplied
Negotiable is not a NegotiableNumeric with
its element being of the same Class as this class', or
if there is no common value (i.e the values are not equal), the
negotiation will fail and null will be returned.
Parameters: other - The Negotiable to negotiate with. |
|
|
|