public final class Referenznummer10 extends Number implements Comparable
A Referenznummer10 is a positive integer with a maximum of ten digits.
Modifier and Type | Field and Description |
---|---|
static int |
ELECTRONIC_FORMAT
Constant for the electronic format of a Referenznummer10.
|
static int |
LETTER_FORMAT
Constant for the letter format of a Referenznummer10.
|
static int |
MAX_CHARACTERS
Maximum number of characters of a Referenznummer10.
|
static int |
MAX_DIGITS
Maximum number of digits of a Referenznummer10.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
checkReferenznummer10(Number referenceCode)
Checks a given number to conform to a Referenznummer10.
|
int |
compareTo(Object o)
Compares this object with the specified object for order.
|
double |
doubleValue()
Returns this Referenznummer10 as a double value.
|
boolean |
equals(Object o)
Indicates whether some other object is equal to this one.
|
float |
floatValue()
Returns this Referenznummer10 as a float value.
|
String |
format(int style)
Formats a Referenznummer10 to produce a string.
|
StringBuffer |
format(int style,
StringBuffer toAppendTo)
Formats a Referenznummer10 and appends the resulting text to the given string buffer.
|
int |
hashCode()
Returns a hash code value for this object.
|
int |
intValue()
Returns this Referenznummer10 as an int value.
|
long |
longValue()
Returns this Referenznummer10 as a long value.
|
static Referenznummer10 |
parse(String referenceCode)
Parses text from the beginning of the given string to produce a
Referenznummer10 . |
static Referenznummer10 |
parse(String referenceCode,
ParsePosition pos)
Parses text from a string to produce a
Referenznummer10 . |
String |
toString()
Returns a string representation of the object.
|
static String |
toString(Referenznummer10 referenznummer10)
Formats a Referenznummer10 to produce a string.
|
static Referenznummer10 |
valueOf(Number referenceCode)
Returns an instance for the Referenznummer10 identified by the given number.
|
static Referenznummer10 |
valueOf(String referenceCode)
Parses text from the beginning of the given string to produce a
Referenznummer10 . |
byteValue, shortValue
public static final int ELECTRONIC_FORMAT
The electronic format of a Referenznummer10 is a ten digit number with leading zeros omitted (e.g. 6789).
public static final int LETTER_FORMAT
The letter format of a Referenznummer10 is a ten 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 digit (e.g. 123 456 789 0).
public static final int MAX_CHARACTERS
public static final int MAX_DIGITS
public static boolean checkReferenznummer10(Number referenceCode)
referenceCode
- The number to check.true
if referenceCode
is a valid Referenznummer10; 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 Referenznummer10 parse(String referenceCode) throws ParseException
Referenznummer10
.
Unlike the parse(String, ParsePosition)
method this method throws a ParseException
if
referenceCode
cannot be parsed or is of invalid length.
referenceCode
- A Referenznummer10 in either electronic or letter format.NullPointerException
- if referenceCode
is null
.ParseException
- if the parse fails or referenceCode
is of invalid length.public static Referenznummer10 parse(String referenceCode, ParsePosition pos)
Referenznummer10
.
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 Referenznummer10 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(Referenznummer10 referenznummer10)
referenznummer10.format(ELECTRONIC_FORMAT)
referenznummer10
- The Referenznummer10
instance to format.NullPointerException
- if referenznummer10
is null
.public static Referenznummer10 valueOf(Number referenceCode)
referenceCode
- A number identifying a Referenznummer10.referenceCode
.NullPointerException
- if referenceCode
is null
.IllegalArgumentException
- if referenceCode
is negative, zero or greater than 9999999999.checkReferenznummer10(Number)
public static Referenznummer10 valueOf(String referenceCode)
Referenznummer10
.
Unlike the parse(String)
method this method throws an IllegalArgumentException
if
referenceCode
cannot be parsed or is of invalid length.
referenceCode
- A Referenznummer10 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.