|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jsmpp.util.SimpleCapacityPolicy
public class SimpleCapacityPolicy
Simple implementation of CapacityPolicy
.
The calculation looks like
int newCapcity = (currentCapacity * 3) / 2 + 1
and it's only apply if currentCapacity is not greater or equals than requiredCapacity.
Constructor Summary | |
---|---|
SimpleCapacityPolicy()
|
Method Summary | |
---|---|
int |
ensureCapacity(int requiredCapacity,
int currentCapacity)
Ensuring the currentCapacity is save to accommodate new items that totally defined as requiredCapacity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleCapacityPolicy()
Method Detail |
---|
public int ensureCapacity(int requiredCapacity, int currentCapacity)
CapacityPolicy
ensureCapacity
in interface CapacityPolicy
requiredCapacity
- is the required capacity.currentCapacity
- is the current capacity.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |