public class StreamLocation extends java.lang.Object implements StreamLocationProvider
StreamLocationProvider, which can be used to store
a static location.StreamLocationProviderOffsetComparator| Constructor and Description |
|---|
StreamLocation(javax.xml.stream.Location location) |
StreamLocation(long characterOffset,
long lineNumber,
long columnNumber) |
StreamLocation(StreamLocationProvider locationProvider) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Note that this method will only return
true, if the other object is also an instance
of this class or an inherited class. |
long |
getCharacterOffset()
Returns the number of characters that have been read from this instance since the beginning of the
underlying stream.
|
long |
getColumnNumber()
Returns the column of the current line, where the cursor of this instance is currently located.
|
long |
getLineNumber()
Returns the number of the line in the stream, where the cursor of this instance is currently located.
|
int |
hashCode() |
public StreamLocation(long characterOffset, long lineNumber, long columnNumber)
public StreamLocation(StreamLocationProvider locationProvider)
public StreamLocation(javax.xml.stream.Location location)
public long getCharacterOffset()
StreamLocationProviderNote that due to the buffering of this class, this value may differ from the number of characters that have been read from the underlying stream.
getCharacterOffset in interface StreamLocationProviderpublic long getLineNumber()
StreamLocationProvider
This reader keeps track of the line number by monitoring each line separator that is read. Supported
line separators are '\n', '\r' or '\r\n'.
getLineNumber in interface StreamLocationProviderpublic long getColumnNumber()
StreamLocationProvidergetColumnNumber in interface StreamLocationProviderStreamLocationProvider.getLineNumber()public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
true, if the other object is also an instance
of this class or an inherited class. It will not return true if the passed object is
a different implementation of StreamLocationProvider, since it is not guaranteed that
such implementations would have a symmetric equals method.equals in class java.lang.ObjectObject.equals(java.lang.Object)