|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.remote.NegotiableNumeric
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.
Constructor Summary | |
NegotiableNumeric(byte b)
Creates a NegotiableNumeric given a byte . |
|
NegotiableNumeric(double d)
Creates a NegotiableNumeric given a double . |
|
NegotiableNumeric(float f)
Creates a NegotiableNumeric given a float . |
|
NegotiableNumeric(int i)
Creates a NegotiableNumeric given an int . |
|
NegotiableNumeric(long l)
Creates a NegotiableNumeric given a long . |
|
NegotiableNumeric(Number n)
Creates a NegotiableNumeric given a Number . |
|
NegotiableNumeric(short s)
Creates a NegotiableNumeric given a short . |
Method Summary | |
Object |
getNegotiatedValue()
Returns the result of the negotiation as a Number
subclass. |
byte |
getNegotiatedValueAsByte()
A convenience method to return the single negotiated value as a byte . |
double |
getNegotiatedValueAsDouble()
A convenience method to return the single negotiated value as a double . |
float |
getNegotiatedValueAsFloat()
A convenience method to return the single negotiated value as a float . |
int |
getNegotiatedValueAsInt()
A convenience method to return the single negotiated value as a int . |
long |
getNegotiatedValueAsLong()
A convenience method to return the single negotiated value as a long . |
short |
getNegotiatedValueAsShort()
A convenience method to return the single negotiated value as a short . |
Class |
getNegotiatedValueClass()
Returns the Class of the negotiated value. |
Number |
getNumber()
Returns the Number that is currently the valid value
for this class. |
Negotiable |
negotiate(Negotiable other)
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NegotiableNumeric(byte b)
NegotiableNumeric
given a byte
.b
- The byte
to be wrapped to implement
Negotiable
.public NegotiableNumeric(short s)
NegotiableNumeric
given a short
.s
- The short
to be wrapped to implement
Negotiable
.public NegotiableNumeric(int i)
NegotiableNumeric
given an int
.i
- The int
to be wrapped to implement
Negotiable
.public NegotiableNumeric(long l)
NegotiableNumeric
given a long
.l
- The long
to be wrapped to implement
Negotiable
.public NegotiableNumeric(float f)
NegotiableNumeric
given a float
.f
- The float
to be wrapped to implement
Negotiable
.public NegotiableNumeric(double d)
NegotiableNumeric
given a double
.d
- The double
to be wrapped to implement
Negotiable
.public NegotiableNumeric(Number n)
NegotiableNumeric
given a Number
.n
- The Number
to be wrapped to implement
Negotiable
.IllegalArgumentException
- if n is null.Method Detail |
public Number getNumber()
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
.public Negotiable negotiate(Negotiable other)
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.negotiate
in interface Negotiable
other
- The Negotiable
to negotiate with.public Object getNegotiatedValue()
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
.getNegotiatedValue
in interface Negotiable
public Class getNegotiatedValueClass()
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.getNegotiatedValueClass
in interface Negotiable
public byte getNegotiatedValueAsByte()
byte
.ClassCastException
- if the value is of a different Class type.public short getNegotiatedValueAsShort()
short
.ClassCastException
- if the value is of a different Class type.public int getNegotiatedValueAsInt()
int
.ClassCastException
- if the value is of a different Class type.public long getNegotiatedValueAsLong()
long
.ClassCastException
- if the value is of a different Class type.public float getNegotiatedValueAsFloat()
float
.ClassCastException
- if the value is of a different Class type.public double getNegotiatedValueAsDouble()
double
.ClassCastException
- if the value is of a different Class type.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |