Hilbert II - Version 0.03.04

org.qedeq.kernel.parser
Class Operator

java.lang.Object
  extended byorg.qedeq.kernel.parser.Operator

public final class Operator
extends Object

This class describes an term or logical operator. An operator is of either prefix, infix or postfix type and has a minimum and maximum number of operands. It has a symbol or token that enables to recognize it and a QEDEQ representation.

Version:
$Revision: 1.4 $

Field Summary
static int FUNCTION
          Marks function operator.
static int INFIX
          Marks infix operator.
static int POSTFIX
          Marks postfix operator.
static int SIMPLE_PREFIX
          Marks prefix operator.
 
Constructor Summary
Operator(String symbol, String qedeq, String qedeqArgument, int priority, int type, int min)
          Constructor.
Operator(String symbol, String qedeq, String qedeqArgument, int priority, int type, int min, int max)
          Constructor.
Operator(String startSymbol, String separatorSymbol, String endSymbol, String qedeq, String qedeqArgument, int priority, int min)
          Constructor for prefix operators like {x | x > 0}.
Operator(String startSymbol, String separatorSymbol, String endSymbol, String qedeq, String qedeqArgument, int priority, int min, int max)
          Constructor for prefix operators like {x, y, z}.
Operator(String startSymbol, String separatorSymbol, String endSymbol, String qedeq, String qedeqArgument, int priority, int type, int min, int max)
          Constructor.
 
Method Summary
 String getEndSymbol()
          Returns symbol or token to identify the end of this operator.
 int getMax()
          Get maximum argument number.
 int getMin()
          Get minimum argument number.
 int getPriority()
          Get operator priority. 0 is the highest priority.
 String getQedeq()
          Get QEDEQ operator name.
 String getQedeqArgument()
          Get first QEDEQ argument.
 String getSeparatorSymbol()
          Returns symbol or token to separate different arguments for this operator.
 String getStartSymbol()
          Returns symbol or token to identify this operator.
 boolean isFunction()
          Is this a function operator?
 boolean isInfix()
          Is this an infix operator?
 boolean isPostfix()
          Is this a postfix operator?
 boolean isPrefix()
          Is this a prefix operator?
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INFIX

public static final int INFIX
Marks infix operator.

See Also:
Constant Field Values

SIMPLE_PREFIX

public static final int SIMPLE_PREFIX
Marks prefix operator.

See Also:
Constant Field Values

POSTFIX

public static final int POSTFIX
Marks postfix operator.

See Also:
Constant Field Values

FUNCTION

public static final int FUNCTION
Marks function operator.

See Also:
Constant Field Values
Constructor Detail

Operator

public Operator(String symbol,
                String qedeq,
                String qedeqArgument,
                int priority,
                int type,
                int min)
Constructor.

Parameters:
symbol - Symbol or token for this operator.
qedeq - QEDEQ operator symbol.
qedeqArgument - First Argument in QEDEQ-Syntax - if any.
priority - Operator priority, highest is 0.
type - Prefix, infix or postfix. See SIMPLE_PREFIX, FUNCTION, INFIX and POSTFIX.
min - Minimum number of arguments for this operator.

Operator

public Operator(String symbol,
                String qedeq,
                String qedeqArgument,
                int priority,
                int type,
                int min,
                int max)
Constructor.

Parameters:
symbol - Symbol or token for this operator.
qedeq - QEDEQ operator symbol.
qedeqArgument - First Argument in QEDEQ-Syntax - if any.
priority - Operator priority, highest is 0.
type - Prefix, infix or postfix. See SIMPLE_PREFIX, FUNCTION, INFIX and POSTFIX.
min - Minimum number of arguments for this operator.
max - Maximum number of arguments for this operator.

Operator

public Operator(String startSymbol,
                String separatorSymbol,
                String endSymbol,
                String qedeq,
                String qedeqArgument,
                int priority,
                int min)
Constructor for prefix operators like {x | x > 0}.

Parameters:
startSymbol - Starting symbol or token for this operator.
separatorSymbol - Symbol or token that separates arguments for this operator.
endSymbol - End symbol or token for this operator.
qedeq - QEDEQ operator symbol.
qedeqArgument - First Argument in QEDEQ-Syntax - if any
priority - Operator priority, highest is 0.
min - Minimum number of arguments for this operator.

Operator

public Operator(String startSymbol,
                String separatorSymbol,
                String endSymbol,
                String qedeq,
                String qedeqArgument,
                int priority,
                int min,
                int max)
Constructor for prefix operators like {x, y, z}.

Parameters:
startSymbol - Starting symbol or token for this operator.
separatorSymbol - Symbol or token that separates arguments for this operator.
endSymbol - End symbol or token for this operator.
qedeq - QEDEQ operator symbol.
qedeqArgument - First Argument in QEDEQ-Syntax - if any.
priority - Operator priority, highest is 0.
min - Minimum number of arguments for this operator.
max - Maximum number of arguments for this operator.

Operator

public Operator(String startSymbol,
                String separatorSymbol,
                String endSymbol,
                String qedeq,
                String qedeqArgument,
                int priority,
                int type,
                int min,
                int max)
Constructor.

Parameters:
startSymbol - Starting symbol or token for this operator.
separatorSymbol - Symbol or token that separates arguments for this operator.
endSymbol - End symbol or token for this operator.
qedeq - QEDEQ operator symbol.
qedeqArgument - First Argument in QEDEQ-Syntax - if any.
priority - Operator priority, highest is 0.
type - Prefix, infix or postfix. See SIMPLE_PREFIX, FUNCTION, INFIX and POSTFIX.
min - Minimum number of arguments for this operator.
max - Maximum number of arguments for this operator.
Method Detail

getStartSymbol

public final String getStartSymbol()
Returns symbol or token to identify this operator.

Returns:
Symbol or token to identify a start of this operator.

getSeparatorSymbol

public String getSeparatorSymbol()
Returns symbol or token to separate different arguments for this operator. Can only be different from null if this is a prefix operator.

Returns:
Symbol or token to identify the start of a new argument of this operator.

getEndSymbol

public String getEndSymbol()
Returns symbol or token to identify the end of this operator. Can only be different from null if this is a prefix operator.

Returns:
Symbol or token to identify the end of this operator. Maybe null.

isInfix

public final boolean isInfix()
Is this an infix operator?

Returns:
Is this an infix operator?

isPrefix

public final boolean isPrefix()
Is this a prefix operator?

Returns:
Is this a prefix operator?

isFunction

public final boolean isFunction()
Is this a function operator?

Returns:
Is this a function operator?

isPostfix

public final boolean isPostfix()
Is this a postfix operator?

Returns:
Is this a postfix operator?

getPriority

public final int getPriority()
Get operator priority. 0 is the highest priority.

Returns:
Priority.

getMin

public final int getMin()
Get minimum argument number.

Returns:
Minimum argument number.

getMax

public final int getMax()
Get maximum argument number.

Returns:
Maximum argument number.

getQedeq

public final String getQedeq()
Get QEDEQ operator name.

Returns:
QEDEQ operator name.

getQedeqArgument

public final String getQedeqArgument()
Get first QEDEQ argument.

Returns:
First QEDEQ argument. Can be null.

toString

public final String toString()

Hilbert II - Version 0.03.04

©left GNU General Public Licence
All Rights Reserved.