|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.me.parabola.mkgmap.osmstyle.eval.LinkedOp
public class LinkedOp
This is used to implement OR expressions as if each term was a separate indexable expression.
So if you have:
A=1 | B=1 | C=1 {set name='${name} ${A}' | '${B}'; }This is represented by:
A=1 {set name='${name} ${A}' | '${B}'; } B=1 {set name='${name} ${A}' | '${B}'; } C=1 {set name='${name} ${A}' | '${B}'; }So that each term can be index separately. However we need to be able to prevent the second and/or third terms running if the first (or second) matches. That is what this class does. It acts in most respects like the operation it is wrapping, but when a successful evaluation is performed on an element, the test is suppressed for the subsequent terms in the chain.
Field Summary | |
---|---|
protected Op |
wrapped
|
Fields inherited from interface uk.me.parabola.mkgmap.osmstyle.eval.Op |
---|
AND, CLOSE_PAREN, EQUALS, EXISTS, GT, GTE, LT, LTE, NOT, NOT_EQUALS, NOT_EXISTS, OPEN_PAREN, OR, REGEX, VALUE |
Constructor Summary | |
---|---|
protected |
LinkedOp(Op wrapped,
boolean first)
|
Method Summary | |
---|---|
static LinkedOp |
create(Op op,
boolean first)
Create either a LinkedOp or a LinkedBinaryOp as appropriate for the type of operation that is passed in. |
boolean |
eval(Element el)
Evaluate the expression. |
Op |
getFirst()
Get the first operand. |
char |
getType()
|
boolean |
hasHigherPriority(Op other)
Does this operation have a higher priority that the other one? |
boolean |
isType(char value)
|
int |
priority()
|
void |
setFirst(Op first)
|
void |
setLink(LinkedOp link)
|
java.lang.String |
toString()
|
java.lang.String |
value()
Get the value in a 'pure' form, without being quoted in any way. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Op wrapped
Constructor Detail |
---|
protected LinkedOp(Op wrapped, boolean first)
Method Detail |
---|
public boolean eval(Element el)
Op
eval
in interface Op
el
- The OSM element to be tested.
public java.lang.String toString()
toString
in class java.lang.Object
public int priority()
priority
in interface Op
public boolean hasHigherPriority(Op other)
Op
hasHigherPriority
in interface Op
other
- The other operation.public Op getFirst()
Op
getFirst
in interface Op
public void setFirst(Op first)
setFirst
in interface Op
public char getType()
getType
in interface Op
public java.lang.String value()
Op
value
in interface Op
public boolean isType(char value)
isType
in interface Op
public void setLink(LinkedOp link)
public static LinkedOp create(Op op, boolean first)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |