Package org.jooq.types
Class UShort
- java.lang.Object
-
- java.lang.Number
-
- org.jooq.types.UNumber
-
- org.jooq.types.UShort
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<UShort>
public final class UShort extends UNumber implements java.lang.Comparable<UShort>
Theunsigned shorttype- Author:
- Lukas Eder, Jens Nerche
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static UShortMAXA constant holding the maximum value anunsigned shortcan have as UShort, 216-1.static intMAX_VALUEA constant holding the maximum value anunsigned shortcan have, 216-1.static UShortMINA constant holding the minimum value anunsigned shortcan have as UShort, 0.static intMIN_VALUEA constant holding the minimum value anunsigned shortcan have, 0.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UShortadd(int val)UShortadd(UShort val)intcompareTo(UShort o)doubledoubleValue()booleanequals(java.lang.Object obj)floatfloatValue()inthashCode()intintValue()longlongValue()UShortsubtract(int val)UShortsubtract(UShort val)java.math.BigIntegertoBigInteger()Get this number as aBigInteger.java.lang.StringtoString()static UShortvalueOf(int value)Create anunsigned shortstatic UShortvalueOf(short value)Create anunsigned shortby masking it with0xFFFFi.e.static UShortvalueOf(java.lang.String value)Create anunsigned short
-
-
-
Field Detail
-
MIN_VALUE
public static final int MIN_VALUE
A constant holding the minimum value anunsigned shortcan have, 0.- See Also:
- Constant Field Values
-
MAX_VALUE
public static final int MAX_VALUE
A constant holding the maximum value anunsigned shortcan have, 216-1.- See Also:
- Constant Field Values
-
MIN
public static final UShort MIN
A constant holding the minimum value anunsigned shortcan have as UShort, 0.
-
MAX
public static final UShort MAX
A constant holding the maximum value anunsigned shortcan have as UShort, 216-1.
-
-
Method Detail
-
valueOf
public static UShort valueOf(java.lang.String value) throws java.lang.NumberFormatException
Create anunsigned short- Throws:
java.lang.NumberFormatException- Ifvaluedoes not contain a parsableunsigned short.
-
valueOf
public static UShort valueOf(short value)
Create anunsigned shortby masking it with0xFFFFi.e.(short) -1becomes(ushort) 65535
-
valueOf
public static UShort valueOf(int value) throws java.lang.NumberFormatException
Create anunsigned short- Throws:
java.lang.NumberFormatException- Ifvalueis not in the range of anunsigned short
-
intValue
public int intValue()
- Specified by:
intValuein classjava.lang.Number
-
longValue
public long longValue()
- Specified by:
longValuein classjava.lang.Number
-
floatValue
public float floatValue()
- Specified by:
floatValuein classjava.lang.Number
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein classjava.lang.Number
-
toBigInteger
public java.math.BigInteger toBigInteger()
Description copied from class:UNumberGet this number as aBigInteger. This is a convenience method for callingnew BigInteger(toString())- Overrides:
toBigIntegerin classUNumber
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(UShort o)
- Specified by:
compareToin interfacejava.lang.Comparable<UShort>
-
add
public UShort add(UShort val) throws java.lang.NumberFormatException
- Throws:
java.lang.NumberFormatException
-
add
public UShort add(int val) throws java.lang.NumberFormatException
- Throws:
java.lang.NumberFormatException
-
subtract
public UShort subtract(int val)
-
-