1 /*
2 * $Id: Foo.java,v 1.2 2003/04/02 19:49:01 austvold Exp $
3 * Copyright 2003 OErjan Nygaard Austvold. All rights reserved.
4 */
5
6 package org.jdiseq.dummy;
7
8 import java.util.Random;
9
10 /***
11 *
12 * <p>Changelog:
13 * <pre>
14 * $Log: Foo.java,v $
15 * Revision 1.2 2003/04/02 19:49:01 austvold
16 * Minor updates. Mostly adaptation to new event and eventlistener name.
17 * General brush-up on javadoc comments.
18 * Removal of auto-added revision and date-of-commit members.
19 *
20 * Revision 1.1.1.1 2003/03/28 08:18:23 austvold
21 * Initial import.
22 *
23 * </pre>
24 *
25 * @author Ørjan Nygaard Austvold <austvold@acm.org>
26 * @version $Id: Foo.java,v 1.2 2003/04/02 19:49:01 austvold Exp $
27 */
28 class Foo {
29 private static int counter = 0;
30 private static Bar[] bar = new Bar[]{new Bar(), new Bar(), new Bar()};
31
32 private int id = counter++;
33
34 void execute(Random random) {
35 System.err.print("[foo(" + id + ")");
36 if (random.nextInt(100) > 25) { // 75% probability
37 if (random.nextBoolean()) {
38 bar[random.nextInt(3)].execute(random);
39 } else {
40 execute(random);
41 }
42 }
43 System.err.print("]");
44 }
45 }
This page was automatically generated by Maven