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 booleanprivate final booleanprivate longprivate RateLimiter -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePluginLimitedRateGroup(RateLimiter _limiter, boolean _disable_disable) -
Method Summary
Modifier and TypeMethodDescriptionvoidgetName()longGet the current rate limit.booleanBest way to check if rate limiter is effectively disabledbooleanvoidvoidupdateBytesUsed(long 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:
getNamein interfaceLimitedRateGroup
-
getRateLimitBytesPerSecond
public long getRateLimitBytesPerSecond()Description copied from interface:LimitedRateGroupGet the current rate limit.- Specified by:
getRateLimitBytesPerSecondin 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:LimitedRateGroupBest way to check if rate limiter is effectively disabled- Specified by:
isDisabledin interfaceLimitedRateGroup- Returns:
-
updateBytesUsed
public void updateBytesUsed(long used) - Specified by:
updateBytesUsedin interfaceLimitedRateGroup
-