Creates a new ping application with the given settings. @param s Settings to use for initializing the application.
(Settings s)
| 64 | * @param s Settings to use for initializing the application. |
| 65 | */ |
| 66 | public PingApplication(Settings s) { |
| 67 | if (s.contains(PING_PASSIVE)){ |
| 68 | this.passive = s.getBoolean(PING_PASSIVE); |
| 69 | } |
| 70 | if (s.contains(PING_INTERVAL)){ |
| 71 | this.interval = s.getDouble(PING_INTERVAL); |
| 72 | } |
| 73 | if (s.contains(PING_OFFSET)){ |
| 74 | this.lastPing = s.getDouble(PING_OFFSET); |
| 75 | } |
| 76 | if (s.contains(PING_SEED)){ |
| 77 | this.seed = s.getInt(PING_SEED); |
| 78 | } |
| 79 | if (s.contains(PING_PING_SIZE)) { |
| 80 | this.pingSize = s.getInt(PING_PING_SIZE); |
| 81 | } |
| 82 | if (s.contains(PING_PONG_SIZE)) { |
| 83 | this.pongSize = s.getInt(PING_PONG_SIZE); |
| 84 | } |
| 85 | if (s.contains(PING_DEST_RANGE)){ |
| 86 | int[] destination = s.getCsvInts(PING_DEST_RANGE,2); |
| 87 | this.destMin = destination[0]; |
| 88 | this.destMax = destination[1]; |
| 89 | } |
| 90 | |
| 91 | rng = new Random(this.seed); |
| 92 | super.setAppID(APP_ID); |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Copy-constructor |
nothing calls this directly
no test coverage detected