Interface MultiSet.Multiplicity

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int add​(int mult)
      Adds the specified multiplicity (which may well be negative) to the wrapped multiplicity which is thus modified.
      int compareTo​(MultiSet.Multiplicity mult)
      Defines the natural ordering on natural numbers.
      boolean equals​(Object obj)  
      int get()
      Returns the wrapped multiplicity.
      int set​(int mult)
      Sets the multiplicity wrapped by this object to the specified value.
    • Method Detail

      • set

        int set​(int mult)
        Sets the multiplicity wrapped by this object to the specified value.
        Parameters:
        mult - a strictly positive int value representing the old multiplicity.
        Throws:
        IllegalArgumentException - if mult is not strictly positive.
        UnsupportedOperationException - if setting the multiplicity would modify this Multiplicity object in a way which is not supported.
      • add

        int add​(int mult)
        Adds the specified multiplicity (which may well be negative) to the wrapped multiplicity which is thus modified.
        Parameters:
        mult - an int such that this.mult + mult > 0 holds.
        Returns:
        the new multiplicity this.mult + mult.
        Throws:
        IllegalArgumentException - if this.mult + mult < 0 holds.
        IllegalStateException - if this.mult + mult == 0 holds. This cannot occur: if it does this is a bug within this class.
        UnsupportedOperationException - if setting the multiplicity would modify this Multiplicity object in a way which is not supported.
      • get

        int get()
        Returns the wrapped multiplicity.