public void testGetSet() { BitSet bitSet = new BitSet(NUM_BITS); for (int i = 0; i < NUM_BITS; i++) { Assert.False(bitSet.Get(i)); } bitSet.Set(0); bitSet.Set(NUM_BITS - 1); Assert.True(bitSet.Get(0)); Assert.True(bitSet.Get(NUM_BITS - 1)); }
public void testClone() { BitSet bitSet = new BitSet(NUM_BITS); bitSet.Set(NUM_BITS-1); bitSet = (BitSet)bitSet.Clone(); Assert.True(bitSet.Get(NUM_BITS-1)); }
public void testClone() { BitSet bitSet = new BitSet(NUM_BITS); bitSet.Set(NUM_BITS - 1); bitSet = (BitSet)bitSet.Clone(); Assert.True(bitSet.Get(NUM_BITS - 1)); }
public void testClear() { BitSet bitSet = new BitSet(NUM_BITS); for (int i = 0; i < NUM_BITS; i++) { bitSet.Set(i); } for (int i = 0; i < NUM_BITS; i++) { Assert.True(bitSet.Get(i)); } bitSet.Clear(); for (int i = 0; i < NUM_BITS; i++) { Assert.False(bitSet.Get(i)); } }
public V Get(long key) { if (key == NULL) { return(default(V)); } int index = find(key); if (countingAccesses) { recentlyAccessed.Set(index); } return(values[index]); }
public void testGetSet() { BitSet bitSet = new BitSet(NUM_BITS); for (int i = 0; i < NUM_BITS; i++) { Assert.False(bitSet.Get(i)); } bitSet.Set(0); bitSet.Set(NUM_BITS-1); Assert.True(bitSet.Get(0)); Assert.True(bitSet.Get(NUM_BITS-1)); }
public void testBounds2() { BitSet bitSet = new BitSet(NUM_BITS); bitSet.Set(-1); }
public void testBounds1() { BitSet bitSet = new BitSet(NUM_BITS); bitSet.Set(1000); }