Methods Summary |
---|
protected void | setUp()
super.setUp();
sSet = new HashSet<Integer>();
for (int i = ITERATIONS - 1; i >= 0; i--) {
sSet.add(i);
}
|
public int | startPerformance(PerformanceTestCase.Intermediates intermediates)
intermediates.setInternalIterations(ITERATIONS);
return 0;
|
public void | testHashSetAdd()Tests performance for the HashSet method Add(Object arg 0)
HashSet set = new HashSet();
for (int i = ITERATIONS - 1; i >= 0; i--) {
set.add(i);
set.add(i);
set.add(i);
set.add(i);
set.add(i);
set.add(i);
set.add(i);
set.add(i);
set.add(i);
set.add(i);
}
|
public void | testHashSetClone()Tests performance for the HashSet method clone()
HashSet hSet = sSet;
Object set;
for (int i = ITERATIONS - 1; i > 0; i--) {
set = hSet.clone();
set = hSet.clone();
set = hSet.clone();
set = hSet.clone();
set = hSet.clone();
set = hSet.clone();
set = hSet.clone();
set = hSet.clone();
set = hSet.clone();
set = hSet.clone();
}
|
public void | testHashSetContains()Tests performance of HashSet method contains(Object arg 0)
Integer index = new Integer(500);
boolean flag;
HashSet set = sSet;
for (int i = ITERATIONS - 1; i >= 0; i--) {
flag = set.contains(index);
flag = set.contains(index);
flag = set.contains(index);
flag = set.contains(index);
flag = set.contains(index);
flag = set.contains(index);
flag = set.contains(index);
flag = set.contains(index);
flag = set.contains(index);
}
|
public void | testHashSetIsEmpty()Tests performance for the HashSet method isEmpty(Object arg 0)
HashSet set = sSet;
boolean flag;
for (int i = ITERATIONS - 1; i >= 0; i--) {
flag = set.isEmpty();
flag = set.isEmpty();
flag = set.isEmpty();
flag = set.isEmpty();
flag = set.isEmpty();
flag = set.isEmpty();
flag = set.isEmpty();
flag = set.isEmpty();
flag = set.isEmpty();
flag = set.isEmpty();
}
|
public void | testHashSetIterator()Tests performance of the HashSet method -iterator()
Iterator iterator;
HashSet set = sSet;
for (int i = ITERATIONS - 1; i >= 0; i--) {
iterator = set.iterator();
iterator = set.iterator();
iterator = set.iterator();
iterator = set.iterator();
iterator = set.iterator();
iterator = set.iterator();
iterator = set.iterator();
iterator = set.iterator();
iterator = set.iterator();
}
|
public void | testHashSetRemove()Tests performance for the HashSet method Remove(Object arg 0)
HashSet set = new HashSet(sSet);
for (int i = ITERATIONS - 1; i >= 0; i--) {
set.remove(i);
set.remove(i);
set.remove(i);
set.remove(i);
set.remove(i);
set.remove(i);
set.remove(i);
set.remove(i);
set.remove(i);
set.remove(i);
}
|
public void | testHashSetSize()Tests performance of HashSet method size()
int num;
HashSet set = sSet;
for (int i = ITERATIONS - 1; i >= 0; i--) {
num = set.size();
num = set.size();
num = set.size();
num = set.size();
num = set.size();
num = set.size();
num = set.size();
num = set.size();
num = set.size();
}
|