Class ReflectVisitorTest.NumberNegater

    • Constructor Summary

      Constructors 
      Constructor Description
      NumberNegater()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Number negate​(java.lang.Number n)
      Negates the given number.
      java.lang.Number negateWithoutDispatcher​(java.lang.Number n)
      Negates the given number without using a dispatcher object to cache applicable methods.
      • Methods inherited from class java.lang.Object

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

      • result

        protected java.lang.Number result
    • Constructor Detail

      • NumberNegater

        public NumberNegater()
    • Method Detail

      • negate

        public java.lang.Number negate​(java.lang.Number n)
        Negates the given number.
        Parameters:
        n - the number to be negated
        Returns:
        the negated result; not guaranteed to be the same concrete type as n; null is returned if n's type wasn't handled
      • negateWithoutDispatcher

        public java.lang.Number negateWithoutDispatcher​(java.lang.Number n)
        Negates the given number without using a dispatcher object to cache applicable methods. The results should be the same as negate(Number).
        Parameters:
        n - the number to be negated
        Returns:
        the negated result; not guaranteed to be the same concrete type as n; null is returned if n's type wasn't handled