Class RoundRobin.NameValue

  • Enclosing class:
    RoundRobin

    class RoundRobin.NameValue
    extends java.lang.Object
    A inner name value class that associates a string with an int value. This is used to populate the round robin list that is used by this scheduler.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String name
      Stores the name of the pair (the left handside of the mapping).
      private int value
      Stores the corresponding value to the name in the pair.
    • Constructor Summary

      Constructors 
      Constructor Description
      NameValue()
      The default constructor which initialises the class member variables.
      NameValue​(java.lang.String name, int value)
      Initialises the class member variables to the values passed in the arguments.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Returns a copy of this object.
      java.lang.String getName()
      Returns the key of this pair, i.e the left hand side of the mapping.
      int getValue()
      Returns the value associated with this pair.
      void increment()
      Increments the int value by one.
      void setValue​(int value)
      The set method to set the value.
      java.lang.String toString()
      Writes out the contents of the class to a String in form suitable for displaying.
      • Methods inherited from class java.lang.Object

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

      • name

        private java.lang.String name
        Stores the name of the pair (the left handside of the mapping).
      • value

        private int value
        Stores the corresponding value to the name in the pair.
    • Constructor Detail

      • NameValue

        public NameValue()
        The default constructor which initialises the class member variables.
      • NameValue

        public NameValue​(java.lang.String name,
                         int value)
        Initialises the class member variables to the values passed in the arguments.
        Parameters:
        name - corresponds to the name in the NameValue pair
        value - corresponds to the value for the name in the NameValue pair
    • Method Detail

      • setValue

        public void setValue​(int value)
        The set method to set the value.
        Parameters:
        value - int
      • getValue

        public int getValue()
        Returns the value associated with this pair.
        Returns:
        int
      • getName

        public java.lang.String getName()
        Returns the key of this pair, i.e the left hand side of the mapping.
        Returns:
        String
      • increment

        public void increment()
        Increments the int value by one.
      • clone

        public java.lang.Object clone()
        Returns a copy of this object.
        Overrides:
        clone in class java.lang.Object
        Returns:
        Object
      • toString

        public java.lang.String toString()
        Writes out the contents of the class to a String in form suitable for displaying.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String