Package zephyropen.state

Examples of zephyropen.state.TimedEntry


  public String getStats() {

    if (list.isEmpty())
      return "loading...";

    TimedEntry oldest = getOldest();
    TimedEntry newest = getNewest();

    if (oldest == null || newest == null)
      return null;

    return name + " \t [" + list.size() + "]\t" + newest.getAge() + " - "
        + oldest.getAge() + "\t\tmin = " + getMinValueString()
        + "\tavg = " + getAverageValueString() + "\tmax = "
        + getMaxValueString();
  }
View Full Code Here


        + getMaxValueString();
  }

  /** clear the state, but insert the current and average */
  public void reset() {
    TimedEntry avg = new TimedEntry(getAverageValueString());
    TimedEntry now = new TimedEntry(getNewestValueString());
    list.clear();
    insert(avg);
    insert(now);
  }
View Full Code Here

     
      // track input speed
      last = System.currentTimeMillis()
     
      // add this to the data points
      insert(new TimedEntry(buffer / bufferWeigth));
     
      // reset
      bufferCount = 0;
      buffer = 0;
   
View Full Code Here

    if( list.size() < 3 ) return;
   
    // System.out.println("i: " + inflectionPoints );
     
    final double value = getNewest().getValueDouble();
    final TimedEntry lastEntry = getIndex( list.size() - 2 );
    final double last = lastEntry.getValueDouble();
    final double delta = (value - last);
 
    // changing enough to care?
    if( Math.abs(delta) < changeThreashold ) {
      //System.out.print("low: " + delta);
View Full Code Here

    if (data.equals("")) return;
   
    // constants.info("add: " + data + " " + state.size());
   
    // add to state keeping object
    state.add(new TimedEntry(data));
  }
View Full Code Here

  public void add(String data, long time) {
    if (data == null) return;
    if (data.equals("")) return;
   
    // add to state keeping object
    state.add(new TimedEntry(data, time));
 
View Full Code Here

TOP

Related Classes of zephyropen.state.TimedEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.