Package gnu.lists
Class PairWithPosition
java.lang.Object
gnu.lists.AbstractSequence<Object>
gnu.lists.ExtSequence<Object>
gnu.lists.LList
gnu.lists.Pair
gnu.lists.ImmutablePair
gnu.lists.PairWithPosition
- All Implemented Interfaces:
BoundedHashable
,Consumable
,Sequence<Object>
,SourceLocator
,Externalizable
,Serializable
,Comparable
,Iterable<Object>
,Collection<Object>
,List<Object>
,SequencedCollection<Object>
,SourceLocator
,Locator
- Direct Known Subclasses:
SyntaxForms.PairWithPositionSyntaxForm
A
Pair
with the file name and position it was read from.
Note the position (start/end range) is actually that of the car part.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface gnu.text.SourceLocator
SourceLocator.Simple
-
Field Summary
Fields inherited from class gnu.lists.Pair
car, cdr, incompleteListMarker
Fields inherited from class gnu.lists.AbstractSequence
noInts
Fields inherited from interface gnu.lists.Sequence
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, ELEMENT_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, INT_S16_VALUE, INT_S32_VALUE, INT_S64_VALUE, INT_S8_VALUE, INT_U16_VALUE, INT_U32_VALUE, INT_U64_VALUE, INT_U8_VALUE, OBJECT_VALUE, PRIM_VALUE, PROCESSING_INSTRUCTION_VALUE, TEXT_BYTE_VALUE
-
Constructor Summary
ConstructorsConstructorDescriptionOnly for serialization.PairWithPosition
(SourceLocator where, Object car, Object cdr) PairWithPosition
(Object car, Object cdr) -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Return current column number.final int
Column (one-origin) of end of range; unknown/unspecified is -1.final int
Line number (one-origin) of end of range; unknown/unspecified is -1.final String
Normally same as getSystemId.final int
Return current line number.final int
Column (one-origin) of start of range; unknown/unspecified is -1.final int
Line number (one-origin) of start of range; unknown/unspecified is -1.void
Should only be used when initializing a PairWithPosition instance.boolean
True if position is unlikely to change.static PairWithPosition
static PairWithPosition
void
final void
setEndLine
(int endline, int endcolumn) final void
final void
setLine
(int lineno) final void
setLine
(int lineno, int colno) void
Methods inherited from class gnu.lists.ImmutablePair
setCar, setCdr
Methods inherited from class gnu.lists.Pair
compareTo, compareTo, equals, equals, get, getCar, getCdr, getPosNext, getPosPrevious, hasNext, isEmpty, lastPair, length, make, nextPos, readResolve, setCarBackdoor, setCdrBackdoor, size, toArray, toArray
Methods inherited from class gnu.lists.LList
boundedHash, chain1, chain4, checkNonList, consume, consX, createPos, createRelativePos, getIterator, hashCode, length, list1, list2, list3, list4, listLength, makeList, makeList, makeList, reverseInPlace, setPosNext, setPosPrevious, toString
Methods inherited from class gnu.lists.ExtSequence
copyPos, isAfterPos, nextIndex, releasePos
Methods inherited from class gnu.lists.AbstractSequence
add, add, addAll, addAll, addPos, asImmutable, badRank, checkCanWrite, checkRank, clear, compare, compare, compare, consume, consumeNext, consumePosRange, contains, containsAll, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, elements, endPos, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, firstChildPos, fromEndIndex, get, get, get, get, getAttribute, getAttributeLength, getBooleanRaw, getByteRaw, getCharRaw, getContainingSequenceSize, getDoubleRaw, getElementKind, getFloatRaw, getIndexDifference, getInt, getInt, getInt, getInt, getInt, getIntRaw, getIterator, getIteratorAtPos, getLongRaw, getLowBound, getNextKind, getNextTypeName, getNextTypeObject, getRaw, getRowMajor, getShortRaw, getSize, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hasPrevious, indexOf, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, parentPos, previousPos, rank, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setAt, setBuffer, setRaw, stableCompare, startPos, subList, subSequence, subSequencePos, toString, unsupported, unsupportedException
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, getFirst, getLast, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, subList
-
Constructor Details
-
PairWithPosition
public PairWithPosition()Only for serialization. -
PairWithPosition
-
PairWithPosition
-
-
Method Details
-
setFile
-
setLine
public final void setLine(int lineno, int colno) -
setEndLine
public final void setEndLine(int endline, int endcolumn) -
setLine
public final void setLine(int lineno) -
getFileName
Description copied from interface:SourceLocator
Normally same as getSystemId.- Specified by:
getFileName
in interfaceSourceLocator
-
getPublicId
- Specified by:
getPublicId
in interfaceLocator
- Specified by:
getPublicId
in interfaceSourceLocator
- Specified by:
getPublicId
in interfaceSourceLocator
-
getSystemId
- Specified by:
getSystemId
in interfaceLocator
- Specified by:
getSystemId
in interfaceSourceLocator
- Specified by:
getSystemId
in interfaceSourceLocator
-
getLineNumber
public final int getLineNumber()Description copied from interface:SourceLocator
Return current line number. Normally the same asgetStartLine()
. The "first" line is line 1; unknown is -1.- Specified by:
getLineNumber
in interfaceLocator
- Specified by:
getLineNumber
in interfaceSourceLocator
- Specified by:
getLineNumber
in interfaceSourceLocator
-
getColumnNumber
public final int getColumnNumber()Description copied from interface:SourceLocator
Return current column number. Normally the same asgetStartColumn()
. The "first" column is column 1; unknown is -1.- Specified by:
getColumnNumber
in interfaceLocator
- Specified by:
getColumnNumber
in interfaceSourceLocator
- Specified by:
getColumnNumber
in interfaceSourceLocator
-
getStartLine
public final int getStartLine()Description copied from interface:SourceLocator
Line number (one-origin) of start of range; unknown/unspecified is -1.- Specified by:
getStartLine
in interfaceSourceLocator
-
getStartColumn
public final int getStartColumn()Description copied from interface:SourceLocator
Column (one-origin) of start of range; unknown/unspecified is -1.- Specified by:
getStartColumn
in interfaceSourceLocator
-
getEndLine
public final int getEndLine()Description copied from interface:SourceLocator
Line number (one-origin) of end of range; unknown/unspecified is -1.- Specified by:
getEndLine
in interfaceSourceLocator
-
getEndColumn
public final int getEndColumn()Description copied from interface:SourceLocator
Column (one-origin) of end of range; unknown/unspecified is -1.- Specified by:
getEndColumn
in interfaceSourceLocator
-
isStableSourceLocation
public boolean isStableSourceLocation()Description copied from interface:SourceLocator
True if position is unlikely to change. True for an expression but not an input file.- Specified by:
isStableSourceLocation
in interfaceSourceLocator
-
make
-
make
-
init
Should only be used when initializing a PairWithPosition instance. -
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classPair
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classPair
- Throws:
IOException
ClassNotFoundException
-