Class OperatorMapping


  • public class OperatorMapping
    extends java.lang.Object
    The mapping of operators to their respective method names. By default, the following mapping is applied.
    OperatorMethod Name
    +operator_plus
    ++operator_plusPlus
    -operator_minus
    --operator_minusMinus
    **operator_power
    *operator_multiply
    /operator_divide
    %operator_modulo
    <<operator_doubleLessThan
    >>operator_doubleGreaterThan
    <<<operator_tripleLessThan
    >>>operator_tripleGreaterThan
    ?:operator_elvis
    <>operator_diamond
    <=>operator_spaceship
    ||operator_or
    &&operator_and
    +=operator_add
    -=operator_remove
    *=operator_multiplyAssign
    /=operator_divideAssign
    %=operator_moduloAssign
    <<=operator_doubleLessThanAssign
    >>=operator_doubleGreaterThanAssign
    >>>=operator_tripleGreaterThanAssign
    ==operator_equals
    ===operator_tripleEquals
    !==operator_tripleNotEquals
    !=operator_notEquals
    <operator_lessThan
    <=operator_lessEqualsThan
    >operator_greaterThan
    >=operator_greaterEqualsThan
    ->operator_mappedTo
    ..operator_upTo
    ..<operator_doubleDotLessThan
    >..operator_greaterThanDoubleDot
    !operator_not
    =>operator_doubleArrow
    Clients may want to override initializeMapping() to add other operators.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.eclipse.xtext.naming.QualifiedName ADD  
      static org.eclipse.xtext.naming.QualifiedName AND  
      protected com.google.common.collect.BiMap<org.eclipse.xtext.naming.QualifiedName,​org.eclipse.xtext.naming.QualifiedName> compoundOperatorMapping  
      static org.eclipse.xtext.naming.QualifiedName DIAMOND  
      static org.eclipse.xtext.naming.QualifiedName DIVIDE  
      static org.eclipse.xtext.naming.QualifiedName DIVIDE_ASSIGN  
      static org.eclipse.xtext.naming.QualifiedName DOUBLE_ARROW  
      static org.eclipse.xtext.naming.QualifiedName DOUBLE_DOT_LESS_THAN  
      static org.eclipse.xtext.naming.QualifiedName DOUBLE_GREATER_THAN  
      static org.eclipse.xtext.naming.QualifiedName DOUBLE_GREATER_THAN_ASSIGN  
      static org.eclipse.xtext.naming.QualifiedName DOUBLE_LESS_THAN  
      static org.eclipse.xtext.naming.QualifiedName DOUBLE_LESS_THAN_ASSIGN  
      static org.eclipse.xtext.naming.QualifiedName ELVIS  
      static org.eclipse.xtext.naming.QualifiedName EQUALS  
      static org.eclipse.xtext.naming.QualifiedName GREATER_EQUALS_THAN  
      static org.eclipse.xtext.naming.QualifiedName GREATER_THAN  
      static org.eclipse.xtext.naming.QualifiedName GREATER_THAN_DOUBLE_DOT  
      static org.eclipse.xtext.naming.QualifiedName LESS_EQUALS_THAN  
      static org.eclipse.xtext.naming.QualifiedName LESS_THAN  
      protected com.google.common.collect.BiMap<org.eclipse.xtext.naming.QualifiedName,​org.eclipse.xtext.naming.QualifiedName> map  
      static org.eclipse.xtext.naming.QualifiedName MAPPED_TO  
      static org.eclipse.xtext.naming.QualifiedName MINUS  
      static org.eclipse.xtext.naming.QualifiedName MINUS_MINUS  
      static org.eclipse.xtext.naming.QualifiedName MODULO  
      static org.eclipse.xtext.naming.QualifiedName MODULO_ASSIGN  
      static org.eclipse.xtext.naming.QualifiedName MULTIPLY  
      static org.eclipse.xtext.naming.QualifiedName MULTIPLY_ASSIGN  
      static org.eclipse.xtext.naming.QualifiedName NOT  
      static org.eclipse.xtext.naming.QualifiedName NOT_EQUALS  
      static java.lang.String OP_PREFIX  
      static org.eclipse.xtext.naming.QualifiedName OR  
      static org.eclipse.xtext.naming.QualifiedName PLUS  
      static org.eclipse.xtext.naming.QualifiedName PLUS_PLUS  
      static org.eclipse.xtext.naming.QualifiedName POWER  
      static org.eclipse.xtext.naming.QualifiedName REMOVE  
      static org.eclipse.xtext.naming.QualifiedName SPACESHIP  
      static org.eclipse.xtext.naming.QualifiedName TRIPLE_EQUALS  
      static org.eclipse.xtext.naming.QualifiedName TRIPLE_GREATER_THAN  
      static org.eclipse.xtext.naming.QualifiedName TRIPLE_GREATER_THAN_ASSIGN  
      static org.eclipse.xtext.naming.QualifiedName TRIPLE_LESS_THAN  
      static org.eclipse.xtext.naming.QualifiedName TRIPLE_NOT_EQUALS  
      static org.eclipse.xtext.naming.QualifiedName UP_TO  
    • Constructor Summary

      Constructors 
      Constructor Description
      OperatorMapping()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.xtext.naming.QualifiedName getCompoundOperator​(org.eclipse.xtext.naming.QualifiedName simpleOperator)  
      java.util.Set<org.eclipse.xtext.naming.QualifiedName> getCompoundOperators()  
      org.eclipse.xtext.naming.QualifiedName getMethodName​(org.eclipse.xtext.naming.QualifiedName operator)  
      org.eclipse.xtext.naming.QualifiedName getOperator​(org.eclipse.xtext.naming.QualifiedName methodName)  
      java.util.Set<org.eclipse.xtext.naming.QualifiedName> getOperators()  
      org.eclipse.xtext.naming.QualifiedName getSimpleOperator​(org.eclipse.xtext.naming.QualifiedName compoundOperator)  
      protected void initializeMapping()  
      boolean isBinaryOperator​(org.eclipse.xtext.naming.QualifiedName operator)  
      boolean isCompoundMethod​(java.lang.String methodName)  
      boolean isUnaryOperator​(org.eclipse.xtext.naming.QualifiedName operator)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PLUS

        public static final org.eclipse.xtext.naming.QualifiedName PLUS
      • PLUS_PLUS

        public static final org.eclipse.xtext.naming.QualifiedName PLUS_PLUS
      • MINUS

        public static final org.eclipse.xtext.naming.QualifiedName MINUS
      • MINUS_MINUS

        public static final org.eclipse.xtext.naming.QualifiedName MINUS_MINUS
      • POWER

        public static final org.eclipse.xtext.naming.QualifiedName POWER
      • MULTIPLY

        public static final org.eclipse.xtext.naming.QualifiedName MULTIPLY
      • DIVIDE

        public static final org.eclipse.xtext.naming.QualifiedName DIVIDE
      • MODULO

        public static final org.eclipse.xtext.naming.QualifiedName MODULO
      • DOUBLE_LESS_THAN

        public static final org.eclipse.xtext.naming.QualifiedName DOUBLE_LESS_THAN
      • DOUBLE_GREATER_THAN

        public static final org.eclipse.xtext.naming.QualifiedName DOUBLE_GREATER_THAN
      • TRIPLE_LESS_THAN

        public static final org.eclipse.xtext.naming.QualifiedName TRIPLE_LESS_THAN
      • TRIPLE_GREATER_THAN

        public static final org.eclipse.xtext.naming.QualifiedName TRIPLE_GREATER_THAN
      • ELVIS

        public static final org.eclipse.xtext.naming.QualifiedName ELVIS
      • DIAMOND

        public static final org.eclipse.xtext.naming.QualifiedName DIAMOND
      • SPACESHIP

        public static final org.eclipse.xtext.naming.QualifiedName SPACESHIP
      • OR

        public static final org.eclipse.xtext.naming.QualifiedName OR
      • AND

        public static final org.eclipse.xtext.naming.QualifiedName AND
      • ADD

        public static final org.eclipse.xtext.naming.QualifiedName ADD
      • REMOVE

        public static final org.eclipse.xtext.naming.QualifiedName REMOVE
      • MULTIPLY_ASSIGN

        public static final org.eclipse.xtext.naming.QualifiedName MULTIPLY_ASSIGN
      • DIVIDE_ASSIGN

        public static final org.eclipse.xtext.naming.QualifiedName DIVIDE_ASSIGN
      • MODULO_ASSIGN

        public static final org.eclipse.xtext.naming.QualifiedName MODULO_ASSIGN
      • DOUBLE_LESS_THAN_ASSIGN

        public static final org.eclipse.xtext.naming.QualifiedName DOUBLE_LESS_THAN_ASSIGN
      • DOUBLE_GREATER_THAN_ASSIGN

        public static final org.eclipse.xtext.naming.QualifiedName DOUBLE_GREATER_THAN_ASSIGN
      • TRIPLE_GREATER_THAN_ASSIGN

        public static final org.eclipse.xtext.naming.QualifiedName TRIPLE_GREATER_THAN_ASSIGN
      • EQUALS

        public static final org.eclipse.xtext.naming.QualifiedName EQUALS
      • TRIPLE_EQUALS

        public static final org.eclipse.xtext.naming.QualifiedName TRIPLE_EQUALS
      • TRIPLE_NOT_EQUALS

        public static final org.eclipse.xtext.naming.QualifiedName TRIPLE_NOT_EQUALS
      • NOT_EQUALS

        public static final org.eclipse.xtext.naming.QualifiedName NOT_EQUALS
      • LESS_THAN

        public static final org.eclipse.xtext.naming.QualifiedName LESS_THAN
      • LESS_EQUALS_THAN

        public static final org.eclipse.xtext.naming.QualifiedName LESS_EQUALS_THAN
      • GREATER_THAN

        public static final org.eclipse.xtext.naming.QualifiedName GREATER_THAN
      • GREATER_EQUALS_THAN

        public static final org.eclipse.xtext.naming.QualifiedName GREATER_EQUALS_THAN
      • MAPPED_TO

        public static final org.eclipse.xtext.naming.QualifiedName MAPPED_TO
      • UP_TO

        public static final org.eclipse.xtext.naming.QualifiedName UP_TO
      • DOUBLE_DOT_LESS_THAN

        public static final org.eclipse.xtext.naming.QualifiedName DOUBLE_DOT_LESS_THAN
      • GREATER_THAN_DOUBLE_DOT

        public static final org.eclipse.xtext.naming.QualifiedName GREATER_THAN_DOUBLE_DOT
      • NOT

        public static final org.eclipse.xtext.naming.QualifiedName NOT
      • DOUBLE_ARROW

        public static final org.eclipse.xtext.naming.QualifiedName DOUBLE_ARROW
      • map

        protected com.google.common.collect.BiMap<org.eclipse.xtext.naming.QualifiedName,​org.eclipse.xtext.naming.QualifiedName> map
      • compoundOperatorMapping

        protected com.google.common.collect.BiMap<org.eclipse.xtext.naming.QualifiedName,​org.eclipse.xtext.naming.QualifiedName> compoundOperatorMapping
    • Constructor Detail

      • OperatorMapping

        public OperatorMapping()
    • Method Detail

      • initializeMapping

        protected void initializeMapping()
      • getMethodName

        public org.eclipse.xtext.naming.QualifiedName getMethodName​(org.eclipse.xtext.naming.QualifiedName operator)
      • getOperator

        public org.eclipse.xtext.naming.QualifiedName getOperator​(org.eclipse.xtext.naming.QualifiedName methodName)
      • getOperators

        public java.util.Set<org.eclipse.xtext.naming.QualifiedName> getOperators()
      • getCompoundOperator

        public org.eclipse.xtext.naming.QualifiedName getCompoundOperator​(org.eclipse.xtext.naming.QualifiedName simpleOperator)
      • getCompoundOperators

        public java.util.Set<org.eclipse.xtext.naming.QualifiedName> getCompoundOperators()
      • getSimpleOperator

        public org.eclipse.xtext.naming.QualifiedName getSimpleOperator​(org.eclipse.xtext.naming.QualifiedName compoundOperator)
      • isCompoundMethod

        public boolean isCompoundMethod​(java.lang.String methodName)
      • isBinaryOperator

        public boolean isBinaryOperator​(org.eclipse.xtext.naming.QualifiedName operator)
      • isUnaryOperator

        public boolean isUnaryOperator​(org.eclipse.xtext.naming.QualifiedName operator)