uk.me.parabola.mkgmap.osmstyle.eval
Interface Op

All Known Subinterfaces:
BinaryOp
All Known Implementing Classes:
AbstractBinaryOp, AbstractOp, AndOp, CloseOp, EqualsOp, ExistsOp, GTEOp, GTOp, LinkedBinaryOp, LinkedOp, LTEOp, LTOp, NotEqualOp, NotExistsOp, NotOp, NumericOp, OpenOp, OrOp, RegexOp, ValueOp

public interface Op

Interface for an operation in the style expression language. Operations need have only one operand, use BinaryOp for when they definitely have two.

Author:
Steve Ratcliffe

Field Summary
static char AND
           
static char CLOSE_PAREN
           
static char EQUALS
           
static char EXISTS
           
static char GT
           
static char GTE
           
static char LT
           
static char LTE
           
static char NOT
           
static char NOT_EQUALS
           
static char NOT_EXISTS
           
static char OPEN_PAREN
           
static char OR
           
static char REGEX
           
static char VALUE
           
 
Method Summary
 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)
           
 java.lang.String value()
          Get the value in a 'pure' form, without being quoted in any way.
 

Field Detail

EQUALS

static final char EQUALS
See Also:
Constant Field Values

GT

static final char GT
See Also:
Constant Field Values

GTE

static final char GTE
See Also:
Constant Field Values

LT

static final char LT
See Also:
Constant Field Values

LTE

static final char LTE
See Also:
Constant Field Values

NOT_EQUALS

static final char NOT_EQUALS
See Also:
Constant Field Values

EXISTS

static final char EXISTS
See Also:
Constant Field Values

NOT_EXISTS

static final char NOT_EXISTS
See Also:
Constant Field Values

AND

static final char AND
See Also:
Constant Field Values

OR

static final char OR
See Also:
Constant Field Values

VALUE

static final char VALUE
See Also:
Constant Field Values

OPEN_PAREN

static final char OPEN_PAREN
See Also:
Constant Field Values

CLOSE_PAREN

static final char CLOSE_PAREN
See Also:
Constant Field Values

NOT

static final char NOT
See Also:
Constant Field Values

REGEX

static final char REGEX
See Also:
Constant Field Values
Method Detail

eval

boolean eval(Element el)
Evaluate the expression.

Parameters:
el - The OSM element to be tested.
Returns:
True if the expression is true for the given element.

hasHigherPriority

boolean hasHigherPriority(Op other)
Does this operation have a higher priority that the other one?

Parameters:
other - The other operation.

getFirst

Op getFirst()
Get the first operand.


setFirst

void setFirst(Op first)

getType

char getType()

value

java.lang.String value()
Get the value in a 'pure' form, without being quoted in any way. If you want the expression in a form that can be printed and used in a style file, then use toString().


isType

boolean isType(char value)

priority

int priority()