Class CollectionsExt.ImmutableMultiplicity

    • Method Detail

      • set

        public int set​(int mult)
        Description copied from interface: MultiSet.Multiplicity
        Sets the multiplicity wrapped by this object to the specified value.
        Specified by:
        set in interface MultiSet.Multiplicity
        Parameters:
        mult - a strictly positive int value representing the old multiplicity.
      • add

        public int add​(int mult)
        Description copied from interface: MultiSet.Multiplicity
        Adds the specified multiplicity (which may well be negative) to the wrapped multiplicity which is thus modified.
        Specified by:
        add in interface MultiSet.Multiplicity
        Parameters:
        mult - an int such that this.mult + mult > 0 holds.
        Returns:
        the new multiplicity this.mult + mult.
      • equals

        public boolean equals​(java.lang.Object obj)
        Returns true if and only if obj is also an instance of Multiplicity and if the wrapped multiplicities coincide.
        Specified by:
        equals in interface MultiSet.Multiplicity
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - an Object value which may well be null.
        Returns:
        a boolean value which indicates whether obj is also an instance of Multiplicity and whether the wrapped multiplicity coincides with this one.
        See Also:
        compareTo(eu.simuline.util.MultiSet.Multiplicity)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object