Package org.apache.sis.internal.storage
Class PRJDataStore.AuxiliaryContent
java.lang.Object
org.apache.sis.internal.storage.PRJDataStore.AuxiliaryContent
- All Implemented Interfaces:
CharSequence
- Enclosing class:
PRJDataStore
Content of a file read by
PRJDataStore.readAuxiliaryFile(String)
.
This is used as a workaround for not being able to return multiple values from a single method.
Instances of this class should be short lived, because they hold larger arrays than necessary.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
AuxiliaryContent
(Object source, char[] buffer, int offset, int length) Wraps (without copying) the given array as the content of an auxiliary file. -
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) Returns the character at the given index.Returns the filename (without path) of the auxiliary file.int
length()
Returns the number of valid characters in this sequence.subSequence
(int start, int end) Returns a sub-sequence of this auxiliary file content.toString()
Copies this auxiliary file content in aString
.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
-
Constructor Details
-
AuxiliaryContent
Wraps (without copying) the given array as the content of an auxiliary file.
-
-
Method Details
-
getFilename
Returns the filename (without path) of the auxiliary file. This information is mainly for producing error messages.- Returns:
- name of the auxiliary file that have been read.
-
length
public int length()Returns the number of valid characters in this sequence.- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index) Returns the character at the given index. For performance reasons this method does not check index bounds. The behavior of this method is undefined if the given index is not smaller thanlength()
. We skip bounds check because this class should be used for Apache SIS internal purposes only.- Specified by:
charAt
in interfaceCharSequence
-
subSequence
Returns a sub-sequence of this auxiliary file content. For performance reasons this method does not perform bound checks. The behavior of this method is undefined if arguments are out of bounds. We skip bounds check because this class should be used for Apache SIS internal purposes only.- Specified by:
subSequence
in interfaceCharSequence
-
toString
Copies this auxiliary file content in aString
. This method does not cache the result; caller should invoke at most once.- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-