Class CandidateSet

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<java.lang.Integer>
candidate.core.CandidateSet
All Implemented Interfaces:
java.lang.Iterable<java.lang.Integer>, java.util.Collection<java.lang.Integer>, java.util.Set<java.lang.Integer>, java.util.SortedSet<java.lang.Integer>

public class CandidateSet
extends java.util.AbstractSet<java.lang.Integer>
implements java.util.SortedSet<java.lang.Integer>
Author:
Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
  • Method Summary

    Modifier and Type Method Description
    java.util.Comparator<? super java.lang.Integer> comparator()  
    static CandidateSet copyOf​(java.util.SortedSet<java.lang.Integer> other)  
    static CandidateSet createAllCandidates()  
    static CandidateSet createCandidatesFromBits​(int bits)  
    static CandidateSet createSingleCandidate​(int candidate)  
    java.lang.Integer first()  
    java.util.SortedSet<java.lang.Integer> headSet​(java.lang.Integer toElement)  
    java.util.Iterator<java.lang.Integer> iterator()  
    java.lang.Integer last()  
    static int pack​(java.lang.Iterable<java.lang.Integer> iterable)  
    boolean remove​(java.lang.Object o)  
    int size()  
    java.util.SortedSet<java.lang.Integer> subSet​(java.lang.Integer fromElement, java.lang.Integer toElement)  
    java.util.SortedSet<java.lang.Integer> tailSet​(java.lang.Integer fromElement)  

    Methods inherited from class java.util.AbstractSet

    equals, hashCode, removeAll

    Methods inherited from class java.util.AbstractCollection

    add, addAll, clear, contains, containsAll, isEmpty, retainAll, toArray, toArray, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    parallelStream, removeIf, stream, toArray

    Methods inherited from interface java.lang.Iterable

    forEach

    Methods inherited from interface java.util.Set

    add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray

    Methods inherited from interface java.util.SortedSet

    spliterator
  • Method Details

    • size

      public int size()
      Specified by:
      size in interface java.util.Collection<java.lang.Integer>
      Specified by:
      size in interface java.util.Set<java.lang.Integer>
      Specified by:
      size in class java.util.AbstractCollection<java.lang.Integer>
    • remove

      public boolean remove​(java.lang.Object o)
      Specified by:
      remove in interface java.util.Collection<java.lang.Integer>
      Specified by:
      remove in interface java.util.Set<java.lang.Integer>
      Overrides:
      remove in class java.util.AbstractCollection<java.lang.Integer>
    • iterator

      public java.util.Iterator<java.lang.Integer> iterator()
      Specified by:
      iterator in interface java.util.Collection<java.lang.Integer>
      Specified by:
      iterator in interface java.lang.Iterable<java.lang.Integer>
      Specified by:
      iterator in interface java.util.Set<java.lang.Integer>
      Specified by:
      iterator in class java.util.AbstractCollection<java.lang.Integer>
    • comparator

      public java.util.Comparator<? super java.lang.Integer> comparator()
      Specified by:
      comparator in interface java.util.SortedSet<java.lang.Integer>
    • subSet

      public java.util.SortedSet<java.lang.Integer> subSet​(java.lang.Integer fromElement, java.lang.Integer toElement)
      Specified by:
      subSet in interface java.util.SortedSet<java.lang.Integer>
    • headSet

      public java.util.SortedSet<java.lang.Integer> headSet​(java.lang.Integer toElement)
      Specified by:
      headSet in interface java.util.SortedSet<java.lang.Integer>
    • tailSet

      public java.util.SortedSet<java.lang.Integer> tailSet​(java.lang.Integer fromElement)
      Specified by:
      tailSet in interface java.util.SortedSet<java.lang.Integer>
    • first

      public java.lang.Integer first()
      Specified by:
      first in interface java.util.SortedSet<java.lang.Integer>
    • last

      public java.lang.Integer last()
      Specified by:
      last in interface java.util.SortedSet<java.lang.Integer>
    • createAllCandidates

      public static CandidateSet createAllCandidates()
    • createSingleCandidate

      public static CandidateSet createSingleCandidate​(int candidate)
    • copyOf

      public static CandidateSet copyOf​(java.util.SortedSet<java.lang.Integer> other)
    • createCandidatesFromBits

      public static CandidateSet createCandidatesFromBits​(int bits)
    • pack

      public static int pack​(java.lang.Iterable<java.lang.Integer> iterable)