All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.satori.mods.suite.XsltModStats Maven / Gradle / Ivy

There is a newer version: 0.1.7
Show newest version
package com.satori.mods.suite;

import com.satori.mods.core.stats.*;

public class XsltModStats implements IStatsProvider {
  private final static XsltModStats zero = new XsltModStats();
  
  public int received = 0;
  public int sent = 0;
  
  public XsltModStats() {
  }
  
  public XsltModStats(XsltModStats other) {
    copyFrom(other);
  }
  
  // IStatsProvider implementation
  
  @Override
  public void collect(IStatsCollector collector) {
    collector.sum("recv", received);
    collector.sum("sent", sent);
  }
  
  @Override
  public void suppress() {
    reset();
  }
  
  // public methods
  
  public void reset() {
    copyFrom(zero);
  }
  
  // private methods
  
  private void copyFrom(XsltModStats other) {
    received = other.received;
    sent = other.sent;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy