public class InitialPositionTable extends PositionTable
SequentFormula
e of a sequent are located. It is the root of the tree of
PositionTables and may be asked for a PosInSequent for a given index
position and a given Sequent.
For simplicity, the an InitialPositionTable has only one row. The various constrained formulae of a sequent are located one level below. In other words the whole sequent is not represented by an empty position list but by the list [0].
Modifier and Type | Field and Description |
---|---|
private ImmutableList<Range> |
javaBlockRanges
Ranges of java blocks
|
private ImmutableList<Range> |
keywordRanges
Ranges of keywords
|
private ImmutableList<Range> |
updateRanges |
children, endPos, startPos
Constructor and Description |
---|
InitialPositionTable()
creates a new Initial PositionTable.
|
Modifier and Type | Method and Description |
---|---|
void |
addJavaBlockRange(Range r)
Adds a range for a java block to the java block list.
|
void |
addKeywordRange(Range r)
Adds a range for a keyword to the keyword list.
|
void |
addUpdateRange(Range r) |
Range[] |
getJavaBlockRanges() |
Range[] |
getKeywordRanges() |
PosInSequent |
getPosInSequent(int index,
SequentPrintFilter filter)
Returns the PosInSequent for a given char position in a
sequent.
|
private PosInSequent |
getTopPIS(ImmutableList<java.lang.Integer> posList,
SequentPrintFilter filter)
Returns a PosInSequent for a given position list,
but without filling in the bounds.
|
Range[] |
getUpdateRanges() |
private int |
indexOfCfma(SequentFormula cfma,
SequentPrintFilter filter)
Returns the index of the constrained formula in the sequent
as printed.
|
ImmutableList<java.lang.Integer> |
pathForPosition(PosInOccurrence pio,
SequentPrintFilter filter)
Returns the path for a given PosInOccurrence.
|
private ImmutableList<java.lang.Integer> |
prependPathInFormula(ImmutableList<java.lang.Integer> p,
PosInOccurrence pio) |
Range |
rangeForIndex(int index)
Returns the character range of the `lowest' subtable that
includes
index in its range. |
Range |
rangeForPath(ImmutableList<java.lang.Integer> path)
Returns the character range for the subtable indicated
by the given integer list.
|
firstStatementRangeForIndex, getChild, getFirstStatementRange, getSequentPIS, pathForIndex, rangeForIndex, rangeForPath, setEnd, setStart, setStart, toString
private ImmutableList<Range> updateRanges
private ImmutableList<Range> keywordRanges
private ImmutableList<Range> javaBlockRanges
public InitialPositionTable()
public PosInSequent getPosInSequent(int index, SequentPrintFilter filter)
index
- the char position that points to the wanted
position in sequentfilter
- the sequent print filter from that was used to
print the sequentprivate PosInSequent getTopPIS(ImmutableList<java.lang.Integer> posList, SequentPrintFilter filter)
posList
- the position list that navigates through
the position tables.filter
- the sequent print filter from that was used to
print the sequentpublic ImmutableList<java.lang.Integer> pathForPosition(PosInOccurrence pio, SequentPrintFilter filter)
pio
- the given PosInOccurrencefilter
- the current filterprivate ImmutableList<java.lang.Integer> prependPathInFormula(ImmutableList<java.lang.Integer> p, PosInOccurrence pio)
private int indexOfCfma(SequentFormula cfma, SequentPrintFilter filter)
cfma
- the sequent formulafilter
- the current filterpublic Range rangeForIndex(int index)
index
in its range.index
- the character index to search for.public Range rangeForPath(ImmutableList<java.lang.Integer> path)
public void addKeywordRange(Range r)
r
- Range of keyword to be addedpublic Range[] getKeywordRanges()
public void addJavaBlockRange(Range r)
r
- Range of keyword to be addedpublic Range[] getJavaBlockRanges()
public void addUpdateRange(Range r)
public Range[] getUpdateRanges()