|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.amino.utility.AdaptEliminationArray
public class AdaptEliminationArray
This class implements similar functionality of EliminationArray
. And
this class try to get some intelligence by adjusting size of elimination
array automatically.
If elimination fails frequently for two reasons, we will adjust size of
elimination array:
Constructor Summary | |
---|---|
AdaptEliminationArray(int arraySize)
Create elimination array with specified size. |
Method Summary | |
---|---|
void |
dump()
dump for debug. |
boolean |
tryAdd(java.lang.Object obj,
int backOff)
Try to add element without touching the central data structure. |
java.lang.Object |
tryRemove(int backOff)
Try to remove element without touching central data structure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AdaptEliminationArray(int arraySize)
arraySize
- the average size of internal array. Size of internal array
will vary between 1 and 2*arraySizeMethod Detail |
---|
public void dump()
public boolean tryAdd(java.lang.Object obj, int backOff) throws java.lang.InterruptedException
tryAdd
in interface IEliminationArray
obj
- the adding objectbackOff
- time in millisecond for sleeping if match haven't been found
immediately.
java.lang.InterruptedException
- throw exception if interruptedpublic java.lang.Object tryRemove(int backOff) throws java.lang.InterruptedException
tryRemove
in interface IEliminationArray
backOff
- time in millisecond for sleeping if match haven't been found
immediately.
java.lang.InterruptedException
- throw exception if be interrupted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |