Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

16
LINES

< > BotCompany Repo | #1030571 // RegularlyClearedAverage

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2759L/16K).

sclass RegularlyClearedAverage > Average {
  NotTooOften clearTimer;
  
  *() {}
  *(NotTooOften *clearTimer) {}

  void add(double d) {
    possiblyClear();
    super.add(d);
  }
  
  void possiblyClear {
    if (clearTimer?!)
      clear();
  }
}

Author comment

Began life as a copy of #1029191

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030571
Snippet name: RegularlyClearedAverage
Eternal ID of this version: #1030571/3
Text MD5: 56a52d56b2b992c98418261c0bc81144
Transpilation MD5: f19bf67937a065636106d9f89fe877e2
Author: stefan
Category: javax / maths
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-01-08 05:30:28
Source code size: 263 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 201 / 429
Version history: 2 change(s)
Referenced in: #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)