gnu.lists
Class PairWithPosition

java.lang.Object
  extended by gnu.lists.AbstractSequence
      extended by gnu.lists.ExtSequence
          extended by gnu.lists.LList
              extended by gnu.lists.Pair
                  extended by gnu.lists.PairWithPosition
All Implemented Interfaces:
Consumable, Sequence, java.io.Externalizable, java.io.Serializable, java.lang.Comparable, java.lang.Iterable, java.util.Collection, java.util.List

public class PairWithPosition
extends Pair

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

See Also:
Serialized Form

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, eofValue, 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
 
Constructor Summary
PairWithPosition()
          Only for serialization.
PairWithPosition(java.lang.Object car, java.lang.Object cdr)
           
PairWithPosition(PairWithPosition where, java.lang.Object car, java.lang.Object cdr)
           
 
Method Summary
 int getColumn()
           
 java.lang.String getFile()
           
 int getLine()
          Get the line number of (the start of) this pair.
static PairWithPosition make(java.lang.Object car, java.lang.Object cdr, java.lang.String filename, int position)
           
static PairWithPosition make(java.lang.Object car, java.lang.Object cdr, java.lang.String filename, int line, int column)
           
 void readExternal(java.io.ObjectInput in)
           
 void setFile(java.lang.String filename)
           
 void setLine(int lineno)
           
 void setLine(int lineno, int colno)
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class gnu.lists.Pair
compareTo, compareTo, equals, equals, get, getPosNext, getPosPrevious, hashCode, hasNext, isEmpty, lastPair, length, make, nextPos, readResolve, size, toArray, toArray
 
Methods inherited from class gnu.lists.LList
chain1, chain4, checkNonList, consume, createPos, createRelativePos, getIterator, length, list1, list2, list3, list4, listLength, listTail, 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, append, append, append, baseUriOfPos, clear, compare, compare, compare, consumeNext, consumePosRange, contains, containsAll, elements, endPos, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, fromEndIndex, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIndexDifference, getIterator, getIteratorAtPos, getLowBound, getNextKind, getNextTypeName, getNextTypeObject, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hasPrevious, indexOf, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, parentPos, previousPos, rank, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, stableCompare, startPos, subList, subSequence, subSequencePos, toString, unsupported
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gnu.lists.Sequence
elements, fill
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList
 

Constructor Detail

PairWithPosition

public PairWithPosition()
Only for serialization.


PairWithPosition

public PairWithPosition(PairWithPosition where,
                        java.lang.Object car,
                        java.lang.Object cdr)

PairWithPosition

public PairWithPosition(java.lang.Object car,
                        java.lang.Object cdr)
Method Detail

setFile

public final void setFile(java.lang.String filename)

setLine

public final void setLine(int lineno,
                          int colno)

setLine

public final void setLine(int lineno)

getFile

public final java.lang.String getFile()

getLine

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


getColumn

public final int getColumn()

make

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

make

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

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class Pair
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class Pair
Throws:
java.io.IOException
java.lang.ClassNotFoundException