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).

1  
sclass RegularlyClearedAverage > Average {
2  
  NotTooOften clearTimer;
3  
  
4  
  *() {}
5  
  *(NotTooOften *clearTimer) {}
6  
7  
  void add(double d) {
8  
    possiblyClear();
9  
    super.add(d);
10  
  }
11  
  
12  
  void possiblyClear {
13  
    if (clearTimer?!)
14  
      clear();
15  
  }
16  
}

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: 132 / 336
Version history: 2 change(s)
Referenced in: [show references]