Class LinearEquation.Term

  • Enclosing class:
    LinearEquation

    public class LinearEquation.Term
    extends java.lang.Object
    A class for each term in the equation
    Author:
    Bhagat
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String variable
      the variable name
      private double weight
      the scalar multiple of the variable
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Term​(double weight, java.lang.String variable)
      constructs a term
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getVariable()  
      double getWeight()  
      void setVariable​(java.lang.String variable)  
      void setWeight​(double weight)  
      java.lang.String toString()
      A way of visualizing each term
      • Methods inherited from class java.lang.Object

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

      • weight

        private double weight
        the scalar multiple of the variable
      • variable

        private java.lang.String variable
        the variable name
    • Constructor Detail

      • Term

        private Term​(double weight,
                     java.lang.String variable)
        constructs a term
        Parameters:
        weight - the weight
        variable - the variable
    • Method Detail

      • getWeight

        public double getWeight()
        Returns:
        the weight
      • setWeight

        public void setWeight​(double weight)
        Parameters:
        weight - the weight to set
      • getVariable

        public java.lang.String getVariable()
        Returns:
        the variable
      • setVariable

        public void setVariable​(java.lang.String variable)
        Parameters:
        variable - the variable to set
      • toString

        public java.lang.String toString()
        A way of visualizing each term
        Overrides:
        toString in class java.lang.Object