MCPcopy Create free account
hub / github.com/akeranen/the-one / PingApplication

Method PingApplication

applications/PingApplication.java:66–93  ·  view source on GitHub ↗

Creates a new ping application with the given settings. @param s Settings to use for initializing the application.

(Settings s)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 14

containsMethod · 0.80
getBooleanMethod · 0.80
getCsvIntsMethod · 0.80
getLastPingMethod · 0.80
getIntervalMethod · 0.80
isPassiveMethod · 0.80
getDestMaxMethod · 0.80
getDestMinMethod · 0.80
getSeedMethod · 0.80
getPongSizeMethod · 0.80
getPingSizeMethod · 0.80
getDoubleMethod · 0.45

Tested by

no test coverage detected