test_class.declarator: set
test_class.modifier: protected
test_class.original_string: protected Set set;
test_class.type: Set
test_class.var_name: set
test_class.file: ontopia-engine/src/test/java/net/ontopia/utils/CompactHashSetTest.java
test_class.identifier: CompactHashSetTest
test_case.body: @Test
    public void testRehash() {
      set.add("hei");
      set.add("hei2");
      set.add("hei3");
      set.add("hei4");
      set.add("bei");
      set.add("bei2");
      set.add("bei3");
      set.add("bei4");
      set.add("_hei");
      set.add("_hei2");
      set.add("_hei3");
      set.add("_hei4");
      set.add("_bei");
      set.add("_bei2");
      set.add("_bei3");
      set.add("_bei4");
      set.add("$_hei");
      set.add("$_hei2");
      set.add("$_hei3");
      set.add("$_hei4");
      set.add("$_bei");
      set.add("$_bei2");
      set.add("$_bei3");
      set.add("$_bei4");
  
      Assert.assertTrue("set(24).size() != 24", set.size() == 24);
      Assert.assertTrue("contained object lost", set.contains("hei"));
      Assert.assertTrue("contained object lost", set.contains("hei2"));
      Assert.assertTrue("contained object lost", set.contains("hei3"));
      Assert.assertTrue("contained object lost", set.contains("hei4"));
      Assert.assertTrue("contained object lost", set.contains("_hei"));
      Assert.assertTrue("contained object lost", set.contains("_hei2"));
      Assert.assertTrue("contained object lost", set.contains("_hei3"));
      Assert.assertTrue("contained object lost", set.contains("_hei4"));
      Assert.assertTrue("contained object lost", set.contains("$_hei"));
      Assert.assertTrue("contained object lost", set.contains("$_hei2"));
      Assert.assertTrue("contained object lost", set.contains("$_hei3"));
      Assert.assertTrue("contained object lost", set.contains("$_hei4"));
    }
test_case.class_method_signature: CompactHashSetTest.testRehash()
test_case.full_signature: @Test public void testRehash()
test_case.identifier: testRehash
test_case.invocations: add add add add add add add add add add add add add add add add add add add add add add add add assertTrue size assertTrue contains assertTrue contains assertTrue contains assertTrue contains assertTrue contains assertTrue contains assertTrue contains assertTrue contains assertTrue contains assertTrue contains assertTrue contains assertTrue contains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRehash()
focal_class.declarator: INITIAL_SIZE = 3
focal_class.modifier: protected final static
focal_class.original_string: protected final static int INITIAL_SIZE = 3;
focal_class.type: int
focal_class.var_name: INITIAL_SIZE
focal_class.declarator: LOAD_FACTOR = 0.75
focal_class.modifier: protected final static
focal_class.original_string: protected final static double LOAD_FACTOR = 0.75;
focal_class.type: double
focal_class.var_name: LOAD_FACTOR
focal_class.declarator: nullObject = new Object()
focal_class.modifier: protected final static
focal_class.original_string: protected final static Object nullObject = new Object();
focal_class.type: Object
focal_class.var_name: nullObject
focal_class.declarator: deletedObject = new Object()
focal_class.modifier: protected final static
focal_class.original_string: protected final static Object deletedObject = new Object();
focal_class.type: Object
focal_class.var_name: deletedObject
focal_class.declarator: elements
focal_class.modifier: protected
focal_class.original_string: protected int elements;
focal_class.type: int
focal_class.var_name: elements
focal_class.declarator: freecells
focal_class.modifier: protected
focal_class.original_string: protected int freecells;
focal_class.type: int
focal_class.var_name: freecells
focal_class.declarator: objects
focal_class.modifier: protected
focal_class.original_string: protected E[] objects;
focal_class.type: E[]
focal_class.var_name: objects
focal_class.declarator: modCount
focal_class.modifier: protected
focal_class.original_string: protected int modCount;
focal_class.type: int
focal_class.var_name: modCount
focal_class.file: ontopia-engine/src/main/java/net/ontopia/utils/CompactHashSet.java
focal_class.identifier: CompactHashSet
focal_class.class_method_signature: CompactHashSet.CompactHashSet()
focal_class.full_signature: public  CompactHashSet()
focal_class.identifier: CompactHashSet
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  CompactHashSet()
focal_class.class_method_signature: CompactHashSet.CompactHashSet(int size)
focal_class.full_signature: public  CompactHashSet(int size)
focal_class.identifier: CompactHashSet
focal_class.modifiers: public
focal_class.parameters: (int size)
focal_class.signature:  CompactHashSet(int size)
focal_class.class_method_signature: CompactHashSet.CompactHashSet(Collection<E> c)
focal_class.full_signature: public  CompactHashSet(Collection<E> c)
focal_class.identifier: CompactHashSet
focal_class.modifiers: public
focal_class.parameters: (Collection<E> c)
focal_class.signature:  CompactHashSet(Collection<E> c)
focal_class.class_method_signature: CompactHashSet.iterator()
focal_class.full_signature: @Override public Iterator<E> iterator()
focal_class.identifier: iterator
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Iterator<E>
focal_class.signature: Iterator<E> iterator()
focal_class.class_method_signature: CompactHashSet.size()
focal_class.full_signature: @Override public int size()
focal_class.identifier: size
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int size()
focal_class.class_method_signature: CompactHashSet.isEmpty()
focal_class.full_signature: @Override public boolean isEmpty()
focal_class.identifier: isEmpty
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isEmpty()
focal_class.class_method_signature: CompactHashSet.contains(Object o)
focal_class.full_signature: @Override public boolean contains(Object o)
focal_class.identifier: contains
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean contains(Object o)
focal_class.class_method_signature: CompactHashSet.add(Object o)
focal_class.full_signature: @Override public boolean add(Object o)
focal_class.identifier: add
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean add(Object o)
focal_class.class_method_signature: CompactHashSet.remove(Object o)
focal_class.full_signature: @Override public boolean remove(Object o)
focal_class.identifier: remove
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean remove(Object o)
focal_class.class_method_signature: CompactHashSet.clear()
focal_class.full_signature: @Override public void clear()
focal_class.identifier: clear
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clear()
focal_class.class_method_signature: CompactHashSet.toArray()
focal_class.full_signature: @Override public Object[] toArray()
focal_class.identifier: toArray
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Object[]
focal_class.signature: Object[] toArray()
focal_class.class_method_signature: CompactHashSet.toArray(T[] a)
focal_class.full_signature: @Override public T[] toArray(T[] a)
focal_class.identifier: toArray
focal_class.modifiers: @Override public
focal_class.parameters: (T[] a)
focal_class.return: T[]
focal_class.signature: T[] toArray(T[] a)
focal_class.class_method_signature: CompactHashSet.dump()
focal_class.full_signature: public void dump()
focal_class.identifier: dump
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void dump()
focal_class.class_method_signature: CompactHashSet.rehash()
focal_class.full_signature: protected void rehash()
focal_class.identifier: rehash
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void rehash()
focal_class.class_method_signature: CompactHashSet.rehash(int newCapacity)
focal_class.full_signature: protected void rehash(int newCapacity)
focal_class.identifier: rehash
focal_class.modifiers: protected
focal_class.parameters: (int newCapacity)
focal_class.return: void
focal_class.signature: void rehash(int newCapacity)
focal_class.superclass: extends java.util.AbstractSet<E>
focal_method.body: protected void rehash() {
      // do we need to increase capacity, or are there so many
      // deleted objects hanging around that rehashing to the same
      // size is sufficient? if 5% (arbitrarily chosen number) of
      // cells can be freed up by a rehash, we do it.
      
      int gargagecells = objects.length - (elements + freecells);
      if (gargagecells / (double) objects.length > 0.05)
        // rehash with same size
        rehash(objects.length);
      else
        // rehash with increased capacity
        rehash(objects.length*2 + 1);
    }
focal_method.class_method_signature: CompactHashSet.rehash()
focal_method.full_signature: protected void rehash()
focal_method.identifier: rehash
focal_method.invocations: rehash rehash
focal_method.modifiers: protected
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void rehash()