public class TokenBucket
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private long |
capacity |
private long |
lastTime |
private long |
rate
Rate in bytes/sec.
|
private long |
tokens |
Constructor and Description |
---|
TokenBucket(long capacity,
long rate) |
private long capacity
private long rate
private long tokens
private long lastTime
public TokenBucket(long capacity, long rate)
capacity
- rate
- public int getTokens(int numTokens)
numTokens
- public java.lang.String toString()
toString
in class java.lang.Object
public void list(java.io.PrintStream out)
out
- an output stream.
CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Group on Interactive Coding of Images (GICI) (contact)