Esempio n. 1
0
  public static final void deleteByHash(final int hash) {
    synchronized (TurnCounter.relayCounters) {
      Iterator<TurnCounter> it = TurnCounter.relayCounters.iterator();

      while (it.hasNext()) {
        if (System.identityHashCode(it.next()) == hash) {
          it.remove();
        }
      }

      TurnCounter.saveCounters();
    }
  }
Esempio n. 2
0
  public static final void stopCounting(final String label) {
    synchronized (TurnCounter.relayCounters) {
      Iterator<TurnCounter> it = TurnCounter.relayCounters.iterator();

      while (it.hasNext()) {
        TurnCounter current = it.next();
        if (current.parsedLabel.equals(label)) {
          it.remove();
        }
      }

      TurnCounter.saveCounters();
    }
  }
Esempio n. 3
0
  public static final void removeWarning(final String label) {
    synchronized (TurnCounter.relayCounters) {
      Iterator<TurnCounter> it = TurnCounter.relayCounters.iterator();

      while (it.hasNext()) {
        TurnCounter counter = it.next();
        if (counter.parsedLabel.equals(label) && counter.exemptions == null) {
          counter.exemptions = TurnCounter.ALL_LOCATIONS;
          counter.label += " loc=*";
        }
      }

      TurnCounter.saveCounters();
    }
  }
Esempio n. 4
0
 public static final void startCounting(final int value, final String label, final String image) {
   synchronized (TurnCounter.relayCounters) {
     TurnCounter.startCountingInternal(value, label, image);
     TurnCounter.saveCounters();
   }
 }
Esempio n. 5
0
 public static final void clearCounters() {
   synchronized (TurnCounter.relayCounters) {
     TurnCounter.relayCounters.clear();
     TurnCounter.saveCounters();
   }
 }