gnu.lists

Class PairWithPosition

Implemented Interfaces:
Comparable, Externalizable, java.util.List, Consumable, Sequence

public class PairWithPosition
extends Pair

A Pair with the file name and position it was read from.

Field Summary

Fields inherited from class gnu.lists.Pair

car, cdr

Fields inherited from class gnu.lists.LList

Empty

Fields inherited from interface gnu.lists.Sequence

ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, EOF_VALUE, FLOAT_VALUE, GROUP_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, eofValue

Constructor Summary

PairWithPosition()
Only for serialization.
PairWithPosition(Object car, Object cdr)
PairWithPosition(PairWithPosition where, Object car, Object cdr)

Method Summary

int
getColumn()
String
getFile()
int
getLine()
Get the line number of (the start of) this pair.
static PairWithPosition
make(Object car, Object cdr, String filename, int position)
static PairWithPosition
make(Object car, Object cdr, String filename, int line, int column)
void
readExternal(ObjectInput in)
void
setFile(String filename)
void
setLine(int lineno)
void
setLine(int lineno, int colno)
void
writeExternal(ObjectOutput out)

Methods inherited from class gnu.lists.Pair

compareTo, compareTo, equals, equals, get, getPosNext, getPosPrevious, hasNext, hashCode, isEmpty, lastPair, length, make, nextPos, readExternal, readResolve, size, toArray, toArray, writeExternal

Methods inherited from class gnu.lists.LList

chain1, chain4, checkNonList, compareTo, consume, createPos, createRelativePos, equals, get, getIterator, getPosNext, getPosPrevious, hasNext, isEmpty, length, list1, list2, list3, list4, listLength, listTail, makeList, makeList, makeList, nextPos, readExternal, readResolve, reverseInPlace, setPosNext, setPosPrevious, size, toString, writeExternal

Methods inherited from class gnu.lists.ExtSequence

copyPos, isAfterPos, nextIndex, releasePos

Methods inherited from class gnu.lists.AbstractSequence

add, add, addAll, addAll, addPos, append, baseUriOfPos, clear, compare, compare, compare, consume, consumeNext, consumePosRange, contains, containsAll, copyPos, createPos, createRelativePos, elements, endPos, equals, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, fromEndIndex, get, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIndexDifference, getIterator, getIterator, getIteratorAtPos, getLowBound, getNextKind, getNextTypeName, getNextTypeObject, getPosNext, getPosPrevious, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hasNext, hasPrevious, hashCode, indexOf, isAfterPos, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, releasePos, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setPosNext, setPosPrevious, size, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, toString, unsupported

Constructor Details

PairWithPosition

public PairWithPosition()
Only for serialization.

PairWithPosition

public PairWithPosition(Object car,
                        Object cdr)

PairWithPosition

public PairWithPosition(PairWithPosition where,
                        Object car,
                        Object cdr)

Method Details

getColumn

public final int getColumn()

getFile

public final String getFile()

getLine

public final int getLine()
Get the line number of (the start of) this pair. The "first" line is line 1.

make

public static PairWithPosition make(Object car,
                                    Object cdr,
                                    String filename,
                                    int position)

make

public static PairWithPosition make(Object car,
                                    Object cdr,
                                    String filename,
                                    int line,
                                    int column)

readExternal

public void readExternal(ObjectInput in)
            throws IOException,
                   ClassNotFoundException
Overrides:
readExternal in interface Pair

setFile

public final void setFile(String filename)

setLine

public final void setLine(int lineno)

setLine

public final void setLine(int lineno,
                          int colno)

writeExternal

public void writeExternal(ObjectOutput out)
            throws IOException
Overrides:
writeExternal in interface Pair