public class IndexItem extends Object
Constructor and Description |
---|
IndexItem(String rawExpression,
String expression,
long indexIn,
boolean previousIn)
Creates a new IndexItem.
|
Modifier and Type | Method and Description |
---|---|
static List<List<IndexItem>> |
collate(List<IndexItem> indexItems,
int targetOffset,
int targetSize)
Creates a list of index items arranged by index.
|
static List<IndexItem> |
evalIndexExpressions(String indexExprs,
List<IndexItem> prev,
DebugContext context)
Evaluates index expressions to create index items.
|
String |
getExpression()
Gets the expression.
|
long |
getIndex()
Gets the index value.
|
String |
getRawExpression()
Gets the raw expression.
|
boolean |
isPrevious()
Determines if the value is old.
|
boolean |
sameMarker(IndexItem ii)
Determines if this is the same marker as another.
|
public IndexItem(String rawExpression, String expression, long indexIn, boolean previousIn)
rawExpression
- the full expression.expression
- the expression to be displayed.indexIn
- the index value.previousIn
- true if the expression was not evaluable and the
previous value is shown, false otherwise.public static List<List<IndexItem>> collate(List<IndexItem> indexItems, int targetOffset, int targetSize)
indexItems
- the items to be arranged.targetOffset
- offset of the first item in the result.targetSize
- size of the result.targetSize
size, where each index contains
a list of the index items with that index minus
targetOffset
, or null if there are no index items with that
relative index.public static List<IndexItem> evalIndexExpressions(String indexExprs, List<IndexItem> prev, DebugContext context)
indexExprs
- the expressions to be evaluated, separated by hashes
(#).prev
- previous index items.context
- the debug context to be used for evaluation.public String getExpression()
public long getIndex()
public String getRawExpression()
public boolean isPrevious()
public boolean sameMarker(IndexItem ii)
ii
- the marker to be compared.