Class ListIntSet

java.lang.Object
com.android.dx.util.ListIntSet
All Implemented Interfaces:
IntSet

public class ListIntSet extends Object implements IntSet
A set of integers, represented by a list
  • Constructor Details

    • ListIntSet

      public ListIntSet()
      Constructs an instance
  • Method Details

    • add

      public void add(int value)
      Adds an int to a set
      Specified by:
      add in interface IntSet
      Parameters:
      value - int to add
    • remove

      public void remove(int value)
      Removes an int from a set.
      Specified by:
      remove in interface IntSet
      Parameters:
      value - int to remove
    • has

      public boolean has(int value)
      Checks to see if a value is in the set
      Specified by:
      has in interface IntSet
      Parameters:
      value - int to check
      Returns:
      true if in set
    • merge

      public void merge(IntSet other)
      Merges other into this set, so this set becomes the union of the two.
      Specified by:
      merge in interface IntSet
      Parameters:
      other - non-null; other set to merge with.
    • elements

      public int elements()
      Returns the count of unique elements in this set.
      Specified by:
      elements in interface IntSet
      Returns:
      > = 0; count of unique elements
    • iterator

      public IntIterator iterator()
      Iterates the set
      Specified by:
      iterator in interface IntSet
      Returns:
      non-null; a set iterator
    • toString

      public String toString()
      Overrides:
      toString in class Object