Class OperationDescription
- java.lang.Object
-
- ru.ispras.fortress.expression.printer.OperationDescription
-
public final class OperationDescription extends java.lang.Object
This class contains information on operation mapping.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OperationDescription.Type
This enumeration contains the operation types.
-
Constructor Summary
Constructors Constructor Description OperationDescription(java.lang.String[] sign)
Constructs an operation description.OperationDescription(java.lang.String[] sign, boolean addSpaces)
Constructs an operation description.OperationDescription(java.lang.String[] sign, boolean addSpaces, int[] order)
Constructs an operation description.OperationDescription(java.lang.String[] sign, int[] order)
Constructs an operation description.OperationDescription(java.lang.String prefix, java.lang.String[] infix, java.lang.String suffix)
Constructs an operation description.OperationDescription(java.lang.String prefix, java.lang.String[] infix, java.lang.String suffix, int[] order)
Constructs an operation description.OperationDescription(java.lang.String prefix, java.lang.String infix, java.lang.String suffix)
Constructs an operation description.OperationDescription(java.lang.String sign, OperationDescription.Type type)
Constructs an operation description.OperationDescription(java.lang.String sign, OperationDescription.Type type, boolean addSpaces)
Constructs an operation description.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getInfix()
Returns the operation infix (string written between two operands).java.lang.String
getInfix(int idx)
Returns thei
-th operation infix (string written betweeni
-th andi+1
-th operands).int[]
getOrder()
Returns the order of operands.java.lang.String
getPrefix()
Returns the operation prefix (string written before the first operand).java.lang.String
getSuffix()
Returns the operation suffix (string written after the last operand).
-
-
-
Constructor Detail
-
OperationDescription
public OperationDescription(java.lang.String prefix, java.lang.String[] infix, java.lang.String suffix, int[] order)
Constructs an operation description.- Parameters:
prefix
- the operation prefix.infix
- the operation infixes.suffix
- the operation suffix.order
- the order of operands.
-
OperationDescription
public OperationDescription(java.lang.String prefix, java.lang.String[] infix, java.lang.String suffix)
Constructs an operation description.- Parameters:
prefix
- the operation prefix.infix
- the operation infixes.suffix
- the operation suffix.
-
OperationDescription
public OperationDescription(java.lang.String prefix, java.lang.String infix, java.lang.String suffix)
Constructs an operation description.- Parameters:
prefix
- the operation prefix.infix
- the operation infix.suffix
- the operation suffix.
-
OperationDescription
public OperationDescription(java.lang.String sign, OperationDescription.Type type, boolean addSpaces)
Constructs an operation description.- Parameters:
sign
- the operation sign.type
- the operation type.addSpaces
- the flag indicating whether spaces before and after the operation sign are required.
-
OperationDescription
public OperationDescription(java.lang.String sign, OperationDescription.Type type)
Constructs an operation description.- Parameters:
sign
- the operation sign.type
- the operation type.
-
OperationDescription
public OperationDescription(java.lang.String[] sign, boolean addSpaces, int[] order)
Constructs an operation description.- Parameters:
sign
- the operation signs.addSpaces
- the flag indicating whether spaces before and after the operation sign are required.order
- the order of operands.
-
OperationDescription
public OperationDescription(java.lang.String[] sign, boolean addSpaces)
Constructs an operation description.- Parameters:
sign
- the operation signs.addSpaces
- the flag indicating whether spaces before and after the operation sign are required.
-
OperationDescription
public OperationDescription(java.lang.String[] sign, int[] order)
Constructs an operation description.- Parameters:
sign
- the operation signs.order
- the order of operands.
-
OperationDescription
public OperationDescription(java.lang.String[] sign)
Constructs an operation description.- Parameters:
sign
- the operation signs.
-
-
Method Detail
-
getPrefix
public java.lang.String getPrefix()
Returns the operation prefix (string written before the first operand).- Returns:
- the operation prefix.
-
getInfix
public java.lang.String getInfix()
Returns the operation infix (string written between two operands).- Returns:
- the operation infix.
-
getInfix
public java.lang.String getInfix(int idx)
Returns thei
-th operation infix (string written betweeni
-th andi+1
-th operands).- Parameters:
idx
- Infix index.- Returns:
- the
i
-th operation infix.
-
getSuffix
public java.lang.String getSuffix()
Returns the operation suffix (string written after the last operand).- Returns:
- the operation suffix.
-
getOrder
public int[] getOrder()
Returns the order of operands.- Returns:
- the array specifying the order of operands or
null
for the standard order.
-
-