Package org.apache.sis.xml
Class NilInternationalString
java.lang.Object
org.apache.sis.xml.NilInternationalString
- All Implemented Interfaces:
Serializable
,CharSequence
,Comparable<org.opengis.util.InternationalString>
,NilObject
,org.opengis.util.InternationalString
final class NilInternationalString
extends Object
implements org.opengis.util.InternationalString, NilObject, Serializable
An empty
InternationalString
which is nil for the given reason.- Since:
- 0.4
- Version:
- 0.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NilReason
The reason why the object is nil.private static final long
For cross-version compatibility. -
Constructor Summary
ConstructorsConstructorDescriptionNilInternationalString
(NilReason reason) Creates a new international string which is nil for the given reason. -
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) Unconditionally throwsIndexOutOfBoundsException
, since we cannot get any character from an empty string.int
compareTo
(org.opengis.util.InternationalString other) Returns 0 if the other string is empty, or -1 otherwise.Returns the reason why this object is nil.int
length()
Returns the length, which is always 0.private Object
Invoked on deserialization for replacing the deserialized instance by the unique instance.subSequence
(int start, int end) Returnsthis
if the range is[0…0]
, or throws an exception otherwise.toString()
Unconditionally returns en empty string.Unconditionally returns en empty string.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
reason
The reason why the object is nil.
-
-
Constructor Details
-
NilInternationalString
NilInternationalString(NilReason reason) Creates a new international string which is nil for the given reason.
-
-
Method Details
-
getNilReason
Returns the reason why this object is nil.- Specified by:
getNilReason
in interfaceNilObject
- Returns:
- the reason why this object contains no information.
- See Also:
-
length
public int length()Returns the length, which is always 0.- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index) Unconditionally throwsIndexOutOfBoundsException
, since we cannot get any character from an empty string.- Specified by:
charAt
in interfaceCharSequence
-
toString
Unconditionally returns en empty string.- Specified by:
toString
in interfaceCharSequence
- Specified by:
toString
in interfaceorg.opengis.util.InternationalString
- Overrides:
toString
in classObject
-
toString
Unconditionally returns en empty string.- Specified by:
toString
in interfaceorg.opengis.util.InternationalString
-
subSequence
Returnsthis
if the range is[0…0]
, or throws an exception otherwise.- Specified by:
subSequence
in interfaceCharSequence
-
compareTo
public int compareTo(org.opengis.util.InternationalString other) Returns 0 if the other string is empty, or -1 otherwise.- Specified by:
compareTo
in interfaceComparable<org.opengis.util.InternationalString>
-
readResolve
Invoked on deserialization for replacing the deserialized instance by the unique instance.- Throws:
ObjectStreamException
-