org.jinterop.dcom.core
Class JIUnsignedFactory

java.lang.Object
  extended by org.jinterop.dcom.core.JIUnsignedFactory

public final class JIUnsignedFactory
extends java.lang.Object

Representation of C++ "Unsigned Types".

Since:
1.15

Constructor Summary
JIUnsignedFactory()
           
 
Method Summary
static IJIUnsigned getUnsigned(java.lang.Number value, int flag)
          Returns an implementation for each of the unsigned type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JIUnsignedFactory

public JIUnsignedFactory()
Method Detail

getUnsigned

public static IJIUnsigned getUnsigned(java.lang.Number value,
                                      int flag)

Returns an implementation for each of the unsigned type. Only 3 types are supported at present Byte, Short, Integer.

Since Java has no support for unsigned types, use a Short for a Byte, Integer for a Short and Long for an Integer. This is to accomodate the entire spectrum for the unsigned type and prevent the rollover problem.

Parameters:
value - Short, Integer, Long only
flag - JIFlags unsigned flags
Returns:
Throws:
java.lang.IllegalArgumentException - if the value is not an instance of the supported types or an incorrect flag has been provided.
See Also:
JIFlags.FLAG_REPRESENTATION_UNSIGNED_BYTE, JIFlags.FLAG_REPRESENTATION_UNSIGNED_SHORT, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT