Package com.biglybt.pifimpl.local.utils
Class UtilitiesImpl.PluginLimitedRateGroup
java.lang.Object
com.biglybt.pifimpl.local.utils.UtilitiesImpl.PluginLimitedRateGroup
- All Implemented Interfaces:
LimitedRateGroup
- Enclosing class:
- UtilitiesImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final boolean
private long
private RateLimiter
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
PluginLimitedRateGroup
(RateLimiter _limiter, boolean _disable_disable) -
Method Summary
Modifier and TypeMethodDescriptionvoid
getName()
int
Get the current rate limit.boolean
Best way to check if rate limiter is effectively disabledboolean
void
void
updateBytesUsed
(int used)
-
Field Details
-
limiter
-
plimiter
-
listeners
-
disable_disable
private final boolean disable_disable -
current_disabled
private boolean current_disabled -
last_sync
private long last_sync
-
-
Constructor Details
-
PluginLimitedRateGroup
-
-
Method Details
-
isDisableDisable
public boolean isDisableDisable() -
addListener
-
removeListener
-
getName
- Specified by:
getName
in interfaceLimitedRateGroup
-
getRateLimitBytesPerSecond
public int getRateLimitBytesPerSecond()Description copied from interface:LimitedRateGroup
Get the current rate limit.- Specified by:
getRateLimitBytesPerSecond
in interfaceLimitedRateGroup
- Returns:
- rate in bytes per second, 0 for unlimited, -1 for disabled (BUT it is better to use isDisabled as some rate limiters implement logical disablement via other means (e.g. a download can implement it by disabling individual peers....)
-
isDisabled
public boolean isDisabled()Description copied from interface:LimitedRateGroup
Best way to check if rate limiter is effectively disabled- Specified by:
isDisabled
in interfaceLimitedRateGroup
- Returns:
-
updateBytesUsed
public void updateBytesUsed(int used) - Specified by:
updateBytesUsed
in interfaceLimitedRateGroup
-