il2.util
Class IntSet

Object
  extended by IntSet

public class IntSet
extends Object

Author:
jdpark

Constructor Summary
IntSet()
          Creates a new instance of IntSet
IntSet(int size)
           
IntSet(int[] entries)
           
IntSet(IntList l)
           
IntSet(IntSet s)
           
 
Method Summary
 boolean add(int value)
           
 boolean appendAdd(int value)
           
 void clear()
           
 boolean contains(int value)
           
 boolean containsAll(IntSet s)
           
 IntSet diff(IntSet s)
           
 boolean equals(Object obj)
           
 int[] excludedIndices(IntSet is)
           
 int get(int ind)
           
 int hashCode()
           
 int indexOf(int value)
           
 int[] indices(IntSet is)
          Returns the indices in this set of the items in the subset
 void insertAt(int index, int value)
           
 IntSet intersection(IntSet s)
           
 boolean isEmpty()
           
 int largest()
           
 void lock()
           
 IntSet randomSubset(int size)
           
 boolean remove(int value)
           
 void removeEntryAt(int index)
           
 void sanityCheck()
           
 IntSet selectRandomly(double fraction)
           
static IntSet singleton(int value)
           
 int size()
           
 IntSet subset(int[] inds)
           
 int[] toArray()
           
 IntList toIntList()
           
 String toString()
           
 IntSet union(IntSet s)
           
 IntSet withoutIndex(int ind)
           
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntSet

public IntSet()
Creates a new instance of IntSet


IntSet

public IntSet(int size)

IntSet

public IntSet(IntSet s)

IntSet

public IntSet(IntList l)

IntSet

public IntSet(int[] entries)
Method Detail

singleton

public static IntSet singleton(int value)

clear

public final void clear()
Since:
20080225

get

public final int get(int ind)

size

public final int size()

subset

public final IntSet subset(int[] inds)

union

public final IntSet union(IntSet s)

intersection

public final IntSet intersection(IntSet s)

diff

public IntSet diff(IntSet s)

indices

public int[] indices(IntSet is)
Returns the indices in this set of the items in the subset


excludedIndices

public int[] excludedIndices(IntSet is)

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object

contains

public final boolean contains(int value)

containsAll

public final boolean containsAll(IntSet s)

removeEntryAt

public final void removeEntryAt(int index)

remove

public final boolean remove(int value)

add

public final boolean add(int value)

appendAdd

public final boolean appendAdd(int value)

indexOf

public final int indexOf(int value)

insertAt

public final void insertAt(int index,
                           int value)

lock

public void lock()

toString

public String toString()
Overrides:
toString in class Object

sanityCheck

public void sanityCheck()

withoutIndex

public IntSet withoutIndex(int ind)

largest

public final int largest()

isEmpty

public final boolean isEmpty()

selectRandomly

public IntSet selectRandomly(double fraction)

randomSubset

public IntSet randomSubset(int size)

toArray

public int[] toArray()

toIntList

public IntList toIntList()


Copyright 2010 UCLA Automated Reasoning Group