gnu.lists

Class PairWithPosition

Implemented Interfaces:
Comparable, Externalizable, java.util.List, org.xml.sax.Locator, Consumable, Sequence, SourceLocator

public class PairWithPosition
extends Pair
implements SourceLocator

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, ELEMENT_VALUE, EOF_VALUE, 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, eofValue

Constructor Summary

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

Method Summary

int
getColumnNumber()
String
getFileName()
int
getLineNumber()
Get the line number of (the start of) this Expression.
String
getPublicId()
String
getSystemId()
boolean
isStableSourceLocation()
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, consX, 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, clear, compare, compare, compare, consume, consumeNext, consumePosRange, contains, containsAll, copyPos, createPos, createRelativePos, elements, endPos, equals, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, 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, unsupportedException

Constructor Details

PairWithPosition

public PairWithPosition()
Only for serialization.

PairWithPosition

public PairWithPosition(Object car,
                        Object cdr)

PairWithPosition

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

Method Details

getColumnNumber

public final int getColumnNumber()
Specified by:
getColumnNumber in interface SourceLocator

getFileName

public final String getFileName()
Specified by:
getFileName in interface SourceLocator

getLineNumber

public final int getLineNumber()
Get the line number of (the start of) this Expression. The "first" line is line 1; unknown is -1.
Specified by:
getLineNumber in interface SourceLocator

getPublicId

public String getPublicId()
Specified by:
getPublicId in interface SourceLocator

getSystemId

public String getSystemId()
Specified by:
getSystemId in interface SourceLocator

isStableSourceLocation

public boolean isStableSourceLocation()
Specified by:
isStableSourceLocation in interface SourceLocator

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