Class Calculator.CalcRequest

  • Enclosing class:
    Calculator

    private class Calculator.CalcRequest
    extends java.lang.Object
    Represents a request which may be sent to a Calculator object.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int a_  
      private int b_  
      private java.lang.String mtype_  
      private int x_  
    • Constructor Summary

      Constructors 
      Constructor Description
      CalcRequest​(java.lang.String mtype, int a, int b)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkResponse​(Response response)
      Checks that the given response is correct for this request.
      Message getMessage()
      Returns a Message object corresponding to this request.
      • Methods inherited from class java.lang.Object

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

      • a_

        private final int a_
      • b_

        private final int b_
      • mtype_

        private final java.lang.String mtype_
      • x_

        private final int x_
    • Constructor Detail

      • CalcRequest

        public CalcRequest​(java.lang.String mtype,
                           int a,
                           int b)
        Constructor.
        Parameters:
        mtype - operation type as an MType string
        a - first parameter
        b - second parameter
    • Method Detail

      • getMessage

        public Message getMessage()
        Returns a Message object corresponding to this request.
      • checkResponse

        public void checkResponse​(Response response)
        Checks that the given response is correct for this request.
        Parameters:
        response - response to check