public final class Referenznummer11 extends Number implements Comparable
A Referenznummer11 is a positive integer with a maximum of eleven digits.
Modifier and Type | Field and Description |
---|---|
static int |
ELECTRONIC_FORMAT
Constant for the electronic format of a Referenznummer11.
|
static int |
LETTER_FORMAT
Constant for the letter format of a Referenznummer11.
|
static int |
MAX_CHARACTERS
Maximum number of characters of a Referenznummer11.
|
static int |
MAX_DIGITS
Maximum number of digits of a Referenznummer11.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
checkReferenznummer11(Number referenceCode)
Checks a given number to conform to a Referenznummer11.
|
int |
compareTo(Object o)
Compares this object with the specified object for order.
|
double |
doubleValue()
Returns this Referenznummer11 as a double value.
|
boolean |
equals(Object o)
Indicates whether some other object is equal to this one.
|
float |
floatValue()
Returns this Referenznummer11 as a float value.
|
String |
format(int style)
Formats a Referenznummer11 to produce a string.
|
StringBuffer |
format(int style,
StringBuffer toAppendTo)
Formats a Referenznummer11 and appends the resulting text to the given string buffer.
|
int |
hashCode()
Returns a hash code value for this object.
|
int |
intValue()
Returns this Referenznummer11 as an int value.
|
long |
longValue()
Returns this Referenznummer11 as a long value.
|
static Referenznummer11 |
parse(String referenceCode)
Parses text from the beginning of the given string to produce a
Referenznummer11 . |
static Referenznummer11 |
parse(String referenceCode,
ParsePosition pos)
Parses text from a string to produce a
Referenznummer11 . |
String |
toString()
Returns a string representation of the object.
|
static String |
toString(Referenznummer11 referenznummer11)
Formats a Referenznummer11 to produce a string.
|
static Referenznummer11 |
valueOf(Number referenceCode)
Returns an instance for the Referenznummer11 identified by the given number.
|
static Referenznummer11 |
valueOf(String referenceCode)
Parses text from the beginning of the given string to produce a
Referenznummer11 . |
byteValue, shortValue
public static final int ELECTRONIC_FORMAT
The electronic format of a Referenznummer11 is an eleven digit number with leading zeros omitted (e.g. 6789).
public static final int LETTER_FORMAT
The letter format of a Referenznummer11 is an eleven digit number with leading zeros omitted separated by spaces between the first three digits and the second three digits, the second three digits and the third three digits, and between the third three digits and the last two digits (e.g. 123 456 789 01).
public static final int MAX_CHARACTERS
public static final int MAX_DIGITS
public static boolean checkReferenznummer11(Number referenceCode)
referenceCode
- The number to check.true
if referenceCode
is a valid Referenznummer11; false
if not.public int compareTo(Object o)
compareTo
in interface Comparable
o
- The Object to be compared.NullPointerException
- if o
is null
.ClassCastException
- if the specified object's type prevents it from being compared to this Object.public double doubleValue()
doubleValue
in class Number
public float floatValue()
floatValue
in class Number
public String format(int style)
format(style, new StringBuffer()).toString()
style
- The style to use (ELECTRONIC_FORMAT
or LETTER_FORMAT
).IllegalArgumentException
- if style
is neither ELECTRONIC_FORMAT
nor LETTER_FORMAT
.ELECTRONIC_FORMAT
,
LETTER_FORMAT
public StringBuffer format(int style, StringBuffer toAppendTo)
style
- The style to use (ELECTRONIC_FORMAT
or LETTER_FORMAT
).toAppendTo
- The buffer to which the formatted text is to be appended.toAppendTo
.NullPointerException
- if toAppendTo
is null
.IllegalArgumentException
- if style
is neither ELECTRONIC_FORMAT
nor LETTER_FORMAT
.ELECTRONIC_FORMAT
,
LETTER_FORMAT
public int hashCode()
public int intValue()
public long longValue()
public static Referenznummer11 parse(String referenceCode) throws ParseException
Referenznummer11
.
Unlike the parse(String, ParsePosition)
method this method throws a ParseException
if
referenceCode
cannot be parsed or is of invalid length.
referenceCode
- A Referenznummer11 in either electronic or letter format.NullPointerException
- if referenceCode
is null
.ParseException
- if the parse fails or referenceCode
is of invalid length.public static Referenznummer11 parse(String referenceCode, ParsePosition pos)
Referenznummer11
.
The method attempts to parse text starting at the index given by pos
. If parsing succeeds, then the
index of pos
is updated to the index after the last character used (parsing does not necessarily use all
characters up to the end of the string), and the parsed value is returned. The updated pos
can be used to
indicate the starting point for the next call to this method.
referenceCode
- A Referenznummer11 in either electronic or letter format.pos
- A ParsePosition
object with index and error index information as described above.null
if the parse fails.NullPointerException
- if either referenceCode
or pos
is null
.public static String toString(Referenznummer11 referenznummer11)
referenznummer11.format(ELECTRONIC_FORMAT)
referenznummer11
- The Referenznummer11
instance to format.NullPointerException
- if referenznummer11
is null
.public static Referenznummer11 valueOf(Number referenceCode)
referenceCode
- A number identifying a Referenznummer11.referenceCode
.IllegalArgumentException
- if referenceCode
is negative, zero or greater than 99999999999.checkReferenznummer11(Number)
public static Referenznummer11 valueOf(String referenceCode)
Referenznummer11
.
Unlike the parse(String)
method this method throws an IllegalArgumentException
if
referenceCode
cannot be parsed or is of invalid length.
referenceCode
- A Referenznummer11 in either electronic or letter format.NullPointerException
- if referenceCode
is null
.IllegalArgumentException
- if the parse fails or referenceCode
is of invalid length.Copyright © 2005–2014 jDTAUS. All rights reserved.