public final class Bankleitzahl extends Number implements Comparable
A Bankleitzahl (BLZ) is a positive integer with a maximum of eight digits. For further information see the Merkblatt Bankleitzahlendatei. An updated version of the document may be found at Deutsche Bundesbank.
BankleitzahlenVerzeichnis
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
ELECTRONIC_FORMAT
Constant for the electronic format of a Bankleitzahl.
|
static int |
LETTER_FORMAT
Constant for the letter format of a Bankleitzahl.
|
static int |
MAX_CHARACTERS
Maximum number of characters of a Bankleitzahl.
|
static int |
MAX_DIGITS
Maximum number of digits of a Bankleitzahl.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
checkBankleitzahl(Number bankCode)
Checks a given number to conform to a Bankleitzahl.
|
int |
compareTo(Object o)
Compares this object with the specified object for order.
|
double |
doubleValue()
Returns this Bankleitzahl as a double value.
|
boolean |
equals(Object o)
Indicates whether some other object is equal to this one.
|
float |
floatValue()
Returns this Bankleitzahl as a float value.
|
String |
format(int style)
Formats a Bankleitzahl to produce a string.
|
StringBuffer |
format(int style,
StringBuffer toAppendTo)
Formats a Bankleitzahl and appends the resulting text to the given string buffer.
|
int |
getClearingAreaCode()
Gets the clearing area code of this Bankleitzahl.
|
int |
getInstituteCode()
Gets the institute code of this Bankleitzahl.
|
int |
getLocalityCode()
Gets the locality code of this Bankleitzahl.
|
int |
getNetworkCode()
Gets the network code of this Bankleitzahl.
|
int |
hashCode()
Returns a hash code value for this object.
|
int |
intValue()
Returns this Bankleitzahl as an int value.
|
boolean |
isClearingAreaCodeSupported()
Gets a flag indicating that this Bankleitzahl provides a clearing area code.
|
boolean |
isLocalityCodeSupported()
Gets a flag indicating that this Bankleitzahl provides a locality code.
|
boolean |
isNetworkCodeSupported()
Gets a flag indicating that this Bankleitzahl provides a network code.
|
long |
longValue()
Returns this Bankleitzahl as a long value.
|
static Bankleitzahl |
parse(String bankCode)
Parses text from the beginning of the given string to produce a
Bankleitzahl . |
static Bankleitzahl |
parse(String bankCode,
ParsePosition pos)
Parses text from a string to produce a
Bankleitzahl . |
String |
toString()
Returns a string representation of the object.
|
static String |
toString(Bankleitzahl bankleitzahl)
Formats a Bankleitzahl to produce a string.
|
static Bankleitzahl |
valueOf(Number bankCode)
Gets a
Bankleitzahl for a given number. |
static Bankleitzahl |
valueOf(String bankCode)
Parses text from the beginning of the given string to produce a
Bankleitzahl . |
byteValue, shortValue
public static final int ELECTRONIC_FORMAT
The electronic format of a Bankleitzahl is an eigth digit number with leading zeros omitted (e.g. 5678).
public static final int LETTER_FORMAT
The letter format of a Bankleitzahl is an eigth digit number with leading zeros omitted separated by spaces between the first three digits and the second three digits, and between the second three digits and the last two digits (e.g. 123 456 78).
public static final int MAX_CHARACTERS
public static final int MAX_DIGITS
public static boolean checkBankleitzahl(Number bankCode)
bankCode
- The number to check.true
if bankCode
is a valid Bankleitzahl; 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 getClearingAreaCode()
UnsupportedOperationException
- if this Bankleitzahl does not provide clearing area information.isClearingAreaCodeSupported()
public int getInstituteCode()
public int getLocalityCode()
UnsupportedOperationException
- if this Bankleitzahl does not provide a locality code.isLocalityCodeSupported()
public int getNetworkCode()
0 | Deutsche Bundesbank |
1 - 3 | Kreditinstitute, soweit nicht in einer der anderen Gruppen erfasst |
4 | Commerzbank |
5 | Girozentralen und Sparkassen |
6 + 9 | Genossenschaftliche Zentralbanken, Kreditgenossenschaften sowie ehemalige Genossenschaften |
7 | Deutsche Bank |
8 | Dresdner Bank |
UnsupportedOperationException
- if this Bankleitzahl does not provide a network code.isNetworkCodeSupported()
public int hashCode()
public int intValue()
public boolean isClearingAreaCodeSupported()
true
if property clearingAreaCode
is supported by this instance; false
if
property clearingAreaCode
is not supported by this instance.getClearingAreaCode()
public boolean isLocalityCodeSupported()
true
if property localityCode
is supported by this instance; false
if property
localityCode
is not supported by this instance.getLocalityCode()
public boolean isNetworkCodeSupported()
true
if property networkCode
is supported by this instance; false
if property
networkCode
is not supported by this instance.getNetworkCode()
public long longValue()
public static Bankleitzahl parse(String bankCode) throws ParseException
Bankleitzahl
.
Unlike the parse(String, ParsePosition)
method this method throws a ParseException
if
bankCode
cannot be parsed or is of invalid length.
bankCode
- A Bankleitzahl in either electronic or letter format.NullPointerException
- if bankCode
is null
.ParseException
- if the parse fails or bankCode
is of invalid length.public static Bankleitzahl parse(String bankCode, ParsePosition pos)
Bankleitzahl
.
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.
bankCode
- A Bankleitzahl 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 bankCode
or pos
is null
.public static String toString(Bankleitzahl bankleitzahl)
bankleitzahl.format(ELECTRONIC_FORMAT)
bankleitzahl
- The Bankleitzahl
instance to format.NullPointerException
- if bankleitzahl
is null
.public static Bankleitzahl valueOf(Number bankCode)
Bankleitzahl
for a given number.bankCode
- A number to get a Bankleitzahl
for.bankCode
.NullPointerException
- if bankCode
is null
.IllegalArgumentException
- if bankCode
is negative, zero, greater than 99999999 or its first digit
is either zero or nine.checkBankleitzahl(Number)
public static Bankleitzahl valueOf(String bankCode)
Bankleitzahl
.
Unlike the parse(String)
method this method throws an IllegalArgumentException
if
bankCode
cannot be parsed or is of invalid length.
bankCode
- A Bankleitzahl in either electronic or letter format.NullPointerException
- if bankCode
is null
.IllegalArgumentException
- if the parse fails or bankCode
is of invalid length.Copyright © 2005–2014 jDTAUS. All rights reserved.