public final class GenericNumberWithB extends GenericNumber
Each digit of the address field is encoded into a semi-octet,
and if there is an odd number of digits then the last semi-octet is assigned a filler.
Unless overridden by a particular StringCodec
,
the filler is 0 and the encoding to semi-octets is as tabulated below.
Decoded character | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | B | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Encoded hexadecimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
GenericNumber.Nature, GenericNumber.NumberingPlan, GenericNumber.NumberQualifier, GenericNumber.Presentation, GenericNumber.Screening
Modifier and Type | Field and Description |
---|---|
static BCDStringCodec<GenericNumber> |
ADDRESS_CODEC
BCD string codec for field Address.
|
Address_value, Nature_value, NumberIncomplete_present, NumberIncomplete_value, NumberingPlan_value, NumberQualifier_value, Presentation_value, Screening_value
isDecoded
encoded
FIELD_ABSENT, FIELD_UNINITIALISED
Constructor and Description |
---|
GenericNumberWithB()
Constructs a new GenericNumberWithB object with no fields set.
|
GenericNumberWithB(byte[] data)
Constructs a new GenericNumberWithB object from network-encoded data.
|
GenericNumberWithB(byte[] data,
int start,
int len)
Constructs a new GenericNumberWithB object from part of network-encoded data.
|
GenericNumberWithB(DataInput in)
Constructs a new GenericNumberWithB object from data deserialized from a stream that was written by
GenericNumber.toStream(DataOutput) . |
GenericNumberWithB(GenericNumber.NumberQualifier numberQualifier,
GenericNumber.Nature nature,
boolean numberIncomplete,
GenericNumber.NumberingPlan numberingPlan,
GenericNumber.Presentation presentation,
GenericNumber.Screening screening,
String address)
Constructs a new GenericNumberWithB object from given values for all fields.
|
GenericNumberWithB(GenericNumber.NumberQualifier numberQualifier,
GenericNumber.Nature nature,
boolean numberIncomplete,
GenericNumber.NumberingPlan numberingPlan,
GenericNumber.Presentation presentation,
GenericNumber.Screening screening,
String address,
StringCodec<GenericNumber> Address_codec)
Constructs a new GenericNumberWithB object from given arguments,
using the given codecs for encoding fields of type String.
|
Modifier and Type | Method and Description |
---|---|
static GenericNumberWithB |
copyOf(GenericNumber from)
Creates a new object of this type, cloning the values of common fields from the given object of any subclass of the same base type.
|
StringCodec<GenericNumber> |
getAddressCodec()
Gets the codec used for field Address.
|
GenericNumberWithB |
setAddress(String value)
Sets the value of the number digits.
|
GenericNumberWithB |
setAddress(String value,
StringCodec<GenericNumber> codec)
Sets the value of the number digits using the given codec.
|
GenericNumberWithB |
setAddressEncoded(EncodedStringWithIndicators encoded)
Sets the encoded value of the number digits to a clone of the given EncodedStringIndicators.
|
GenericNumberWithB |
setNature(GenericNumber.Nature value)
Sets the value of the nature of address indicator.
|
GenericNumberWithB |
setNumberIncomplete(boolean value)
Sets the value of the number incomplete indicator.
|
GenericNumberWithB |
setNumberIncompletePresent(boolean flag)
Sets the presence or absence of the field NumberIncomplete.
|
GenericNumberWithB |
setNumberingPlan(GenericNumber.NumberingPlan value)
Sets the value of the numbering plan indicator.
|
GenericNumberWithB |
setNumberQualifier(GenericNumber.NumberQualifier value)
Sets the value of the number qualifier indicator.
|
GenericNumberWithB |
setPresentation(GenericNumber.Presentation value)
Sets the value of the address presentation restricted indicator.
|
GenericNumberWithB |
setScreening(GenericNumber.Screening value)
Sets the value of the screening indicator.
|
checkFieldsSet, clone, decode, encode, encodedIsInvalid, getAddress, getAddress, getAddressEncoded, getContainedLength, getEncodedForm, getFieldAccessors, getFieldsMap, getNature, getNumberIncomplete, getNumberingPlan, getNumberQualifier, getPresentation, getScreening, hasAddress, hasNature, hasNumberIncomplete, hasNumberingPlan, hasNumberQualifier, hasPresentation, hasScreening, toStream
checkDecode, checkModifyAndDecode
equals, hashCode, toString
checkModify, isReadOnly, setReadOnly
public static final BCDStringCodec<GenericNumber> ADDRESS_CODEC
public GenericNumberWithB()
public GenericNumberWithB(byte[] data)
data
- network-encoded dataNullPointerException
- if data is nullpublic GenericNumberWithB(byte[] data, int start, int len)
start
and is len
bytes long.
The data is not decoded and might not be decodable.data
- network-encoded datastart
- starting offset of network-encoded data in byte arraylen
- default length if not predictableNullPointerException
- if data is nullIllegalArgumentException
- if len is negativepublic GenericNumberWithB(GenericNumber.NumberQualifier numberQualifier, GenericNumber.Nature nature, boolean numberIncomplete, GenericNumber.NumberingPlan numberingPlan, GenericNumber.Presentation presentation, GenericNumber.Screening screening, String address)
numberQualifier
- the number qualifier indicatornature
- the nature of address indicatornumberIncomplete
- the number incomplete indicatornumberingPlan
- the numbering plan indicatorpresentation
- the address presentation restricted indicatorscreening
- the screening indicatoraddress
- the number digitspublic GenericNumberWithB(GenericNumber.NumberQualifier numberQualifier, GenericNumber.Nature nature, boolean numberIncomplete, GenericNumber.NumberingPlan numberingPlan, GenericNumber.Presentation presentation, GenericNumber.Screening screening, String address, StringCodec<GenericNumber> Address_codec)
numberQualifier
- the number qualifier indicatornature
- the nature of address indicatornumberIncomplete
- the number incomplete indicatornumberingPlan
- the numbering plan indicatorpresentation
- the address presentation restricted indicatorscreening
- the screening indicatoraddress
- the number digitsAddress_codec
- StringCodec for addresspublic GenericNumberWithB(DataInput in) throws IOException
GenericNumber.toStream(DataOutput)
.in
- the stream to read fromEOFException
- if reading is pre-empted by end-of-fileIOException
- if the data cannot be readpublic GenericNumberWithB setNumberIncompletePresent(boolean flag) throws IllegalStateException
setNumberIncompletePresent
in class GenericNumber
flag
- whether the field should be marked as presentIllegalStateException
- if this instance has been marked as read-onlypublic GenericNumberWithB setNumberQualifier(GenericNumber.NumberQualifier value) throws IllegalStateException
setNumberQualifier
in class GenericNumber
value
- NumberQualifier representation of the number qualifier indicatorIllegalStateException
public GenericNumberWithB setNature(GenericNumber.Nature value) throws IllegalStateException
setNature
in class GenericNumber
value
- Nature representation of the nature of address indicatorIllegalStateException
public GenericNumberWithB setNumberIncomplete(boolean value) throws IllegalStateException
setNumberIncomplete
in class GenericNumber
value
- boolean representation of the number incomplete indicatorIllegalStateException
public GenericNumberWithB setNumberingPlan(GenericNumber.NumberingPlan value) throws IllegalStateException
setNumberingPlan
in class GenericNumber
value
- NumberingPlan representation of the numbering plan indicatorIllegalStateException
public GenericNumberWithB setPresentation(GenericNumber.Presentation value) throws IllegalStateException
setPresentation
in class GenericNumber
value
- Presentation representation of the address presentation restricted indicatorIllegalStateException
public GenericNumberWithB setScreening(GenericNumber.Screening value) throws IllegalStateException
setScreening
in class GenericNumber
value
- Screening representation of the screening indicatorIllegalStateException
public GenericNumberWithB setAddress(String value) throws IllegalStateException
setAddress
in class GenericNumber
value
- String representation of the number digitsIllegalStateException
public GenericNumberWithB setAddress(String value, StringCodec<GenericNumber> codec) throws IllegalArgumentException
setAddress
in class GenericNumber
value
- String representation of the number digitscodec
- StringCodec to use for encodingIllegalArgumentException
public GenericNumberWithB setAddressEncoded(EncodedStringWithIndicators encoded)
setAddressEncoded
in class GenericNumber
encoded
- EncodedStringWithIndicators representation of the number digitspublic static GenericNumberWithB copyOf(GenericNumber from)
from
- the object from which to copypublic StringCodec<GenericNumber> getAddressCodec()
getAddressCodec
in class GenericNumber