Methods Summary |
---|
public void | addItem(int parm1, java.lang.Object parm2)
|
public void | addItem(java.lang.Object parm1)
|
public void | addModelListener(borland.jbcl.model.VectorModelListener listener)
modelListeners.add(listener);
|
public boolean | canSet(int parm1, boolean parm2)
return false;
|
public void | enableModelEvents(boolean enable)
if (events != enable) {
events = enable;
if (enable)
processModelEvent(new VectorModelEvent(this, VectorModelEvent.STRUCTURE_CHANGED));
}
|
public int | find(java.lang.Object parm1)
long value = ((Long) parm1).longValue();
for (int i = 1; i < count; i++) {
if (primes[i] >= value)
return i;
}
return count-1;
|
public java.lang.Object | get(int parm1)
return new Long(primes[parm1]);
|
public long | getCheckNumber()
return checkNumber;
|
public int | getCount()
return count;
|
public boolean | isVariableSize()
return true;
|
protected void | processModelEvent(borland.jbcl.model.VectorModelEvent e)
if (events && modelListeners.hasListeners()) {
modelListeners.dispatch(e);
yield();
}
|
public void | remove(int parm1)
|
public void | removeAll()
|
public void | removeModelListener(borland.jbcl.model.VectorModelListener listener)
modelListeners.remove(listener);
|
public void | run()
while (count < primes.length - 8){
for (int i = 0; i < 8;i++) {
if (test(testNumber + increment[i])) {
processModelEvent(new VectorModelEvent(this,VectorModelEvent.ITEM_ADDED,count-1));
//yield(); the ListView structureChanged ModelEvent listener method does this so we don't have to
}
}
testNumber += 30;
}
|
public void | set(int parm1, java.lang.Object parm2)
|
boolean | test(long check)
//if square root of the limiting prime, bump the limiting prime
checkNumber = check;
if (check == nextSquare) {
squareSubscript++;
nextSquare = primes[squareSubscript] * primes[squareSubscript];
//System.err.println("nextSquare = " + nextSquare);
return false;
}
int i = 3;
while (i < squareSubscript) {
int start = i;
int end = squareSubscript < (start + 100) ? squareSubscript : start + 100;
for (i = start;i <= end;i++) {
if ((check/primes[i])*primes[i] == check)
return false;
}
}
primes[count++] = check;
return true;
|
public void | touched(int parm1)
|