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 NilReasonThe reason why the object is nil.private static final longFor cross-version compatibility. -
Constructor Summary
ConstructorsConstructorDescriptionNilInternationalString(NilReason reason) Creates a new international string which is nil for the given reason. -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int index) Unconditionally throwsIndexOutOfBoundsException, since we cannot get any character from an empty string.intcompareTo(org.opengis.util.InternationalString other) Returns 0 if the other string is empty, or -1 otherwise.Returns the reason why this object is nil.intlength()Returns the length, which is always 0.private ObjectInvoked on deserialization for replacing the deserialized instance by the unique instance.subSequence(int start, int end) Returnsthisif 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, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints
-
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:
getNilReasonin 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:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) Unconditionally throwsIndexOutOfBoundsException, since we cannot get any character from an empty string.- Specified by:
charAtin interfaceCharSequence
-
toString
Unconditionally returns en empty string.- Specified by:
toStringin interfaceCharSequence- Specified by:
toStringin interfaceorg.opengis.util.InternationalString- Overrides:
toStringin classObject
-
toString
Unconditionally returns en empty string.- Specified by:
toStringin interfaceorg.opengis.util.InternationalString
-
subSequence
Returnsthisif the range is[0…0], or throws an exception otherwise.- Specified by:
subSequencein interfaceCharSequence
-
compareTo
public int compareTo(org.opengis.util.InternationalString other) Returns 0 if the other string is empty, or -1 otherwise.- Specified by:
compareToin interfaceComparable<org.opengis.util.InternationalString>
-
readResolve
Invoked on deserialization for replacing the deserialized instance by the unique instance.- Throws:
ObjectStreamException
-