Class DispatchHelper.DispatchSignature

  • Enclosing class:
    DispatchHelper

    public static class DispatchHelper.DispatchSignature
    extends java.lang.Object
    A dispatch signature is a pair of a simple name and an arity. In that sense it's different from a common understanding of a method signature, since the dispatch signature does not take the parameter types into account but only the number of parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int getArity()
      Returns the number of parameters for this dispatch signature.
      java.lang.String getDispatchCaseName()
      Returns the name of the dispatch cases as they would be compiled to Java.
      java.lang.String getSimpleName()
      Returns the name of the dispatcher method.
      int hashCode()  
      boolean isDispatchCase​(org.eclipse.xtext.common.types.JvmOperation operation)
      Returns true, if the given operation matches this dispatch signature and is therefore a case for this dispatcher.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DispatchSignature

        public DispatchSignature​(java.lang.String simpleName,
                                 int arity)
        Creates a new DispatchHelper.DispatchSignature from a method name and parameter count. The method name may not include the synthesized underscore even though an explicit underscore is ok.
        Parameters:
        simpleName - the simple name of the associated dispatcher function.
        arity - the number of parameters (zero or more)
    • Method Detail

      • getArity

        public int getArity()
        Returns the number of parameters for this dispatch signature.
      • getSimpleName

        public java.lang.String getSimpleName()
        Returns the name of the dispatcher method. That is, the name without a synthetic underscore.
      • getDispatchCaseName

        public java.lang.String getDispatchCaseName()
        Returns the name of the dispatch cases as they would be compiled to Java. The name includes the synthetic underscore.
      • isDispatchCase

        public boolean isDispatchCase​(org.eclipse.xtext.common.types.JvmOperation operation)
        Returns true, if the given operation matches this dispatch signature and is therefore a case for this dispatcher.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object