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, incompleteListMarkerFields inherited from class gnu.lists.AbstractSequence
noIntsFields 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 intReturn current column number.final intColumn (one-origin) of end of range; unknown/unspecified is -1.final intLine number (one-origin) of end of range; unknown/unspecified is -1.final StringNormally same as getSystemId.final intReturn current line number.final intColumn (one-origin) of start of range; unknown/unspecified is -1.final intLine number (one-origin) of start of range; unknown/unspecified is -1.voidShould only be used when initializing a PairWithPosition instance.booleanTrue if position is unlikely to change.static PairWithPositionstatic PairWithPositionvoidfinal voidsetEndLine(int endline, int endcolumn) final voidfinal voidsetLine(int lineno) final voidsetLine(int lineno, int colno) voidMethods inherited from class gnu.lists.ImmutablePair
setCar, setCdrMethods 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, toArrayMethods 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, toStringMethods inherited from class gnu.lists.ExtSequence
copyPos, isAfterPos, nextIndex, releasePosMethods 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, unsupportedExceptionMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods 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:SourceLocatorNormally same as getSystemId.- Specified by:
getFileNamein interfaceSourceLocator
-
getPublicId
- Specified by:
getPublicIdin interfaceLocator- Specified by:
getPublicIdin interfaceSourceLocator- Specified by:
getPublicIdin interfaceSourceLocator
-
getSystemId
- Specified by:
getSystemIdin interfaceLocator- Specified by:
getSystemIdin interfaceSourceLocator- Specified by:
getSystemIdin interfaceSourceLocator
-
getLineNumber
public final int getLineNumber()Description copied from interface:SourceLocatorReturn current line number. Normally the same asgetStartLine(). The "first" line is line 1; unknown is -1.- Specified by:
getLineNumberin interfaceLocator- Specified by:
getLineNumberin interfaceSourceLocator- Specified by:
getLineNumberin interfaceSourceLocator
-
getColumnNumber
public final int getColumnNumber()Description copied from interface:SourceLocatorReturn current column number. Normally the same asgetStartColumn(). The "first" column is column 1; unknown is -1.- Specified by:
getColumnNumberin interfaceLocator- Specified by:
getColumnNumberin interfaceSourceLocator- Specified by:
getColumnNumberin interfaceSourceLocator
-
getStartLine
public final int getStartLine()Description copied from interface:SourceLocatorLine number (one-origin) of start of range; unknown/unspecified is -1.- Specified by:
getStartLinein interfaceSourceLocator
-
getStartColumn
public final int getStartColumn()Description copied from interface:SourceLocatorColumn (one-origin) of start of range; unknown/unspecified is -1.- Specified by:
getStartColumnin interfaceSourceLocator
-
getEndLine
public final int getEndLine()Description copied from interface:SourceLocatorLine number (one-origin) of end of range; unknown/unspecified is -1.- Specified by:
getEndLinein interfaceSourceLocator
-
getEndColumn
public final int getEndColumn()Description copied from interface:SourceLocatorColumn (one-origin) of end of range; unknown/unspecified is -1.- Specified by:
getEndColumnin interfaceSourceLocator
-
isStableSourceLocation
public boolean isStableSourceLocation()Description copied from interface:SourceLocatorTrue if position is unlikely to change. True for an expression but not an input file.- Specified by:
isStableSourceLocationin interfaceSourceLocator
-
make
-
make
-
init
Should only be used when initializing a PairWithPosition instance. -
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classPair- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classPair- Throws:
IOExceptionClassNotFoundException
-