Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | package de.viathinksoft.distributed.apps.immortal.iterator; |
2 | |||
3 | import java.math.BigInteger; |
||
4 | |||
5 | import de.viathinksoft.distributed.apps.immortal.deepcheck.DeepImmortalCheckIterator; |
||
6 | import de.viathinksoft.distributed.apps.immortal.deepcheck.DeepImmortalCheckState; |
||
7 | |||
8 | |||
9 | public class QuickImmortableCheck { |
||
10 | |||
11 | public static final int iterationCount = 5; |
||
12 | |||
13 | public static boolean check(BigInteger number) { |
||
14 | DeepImmortalCheckState cs = new DeepImmortalCheckState(false, BigInteger.ZERO, number, number); |
||
15 | DeepImmortalCheckIterator x = new DeepImmortalCheckIterator(cs); |
||
16 | for (int i = 0; i < iterationCount; i++) { |
||
17 | cs = x.next(); |
||
18 | } |
||
19 | return cs.isImmortal(); |
||
20 | } |
||
21 | |||
22 | private QuickImmortableCheck() { |
||
23 | } |
||
24 | |||
25 | } |