public class PriorityCondition extends java.lang.Object implements Condition
Priority condition must not be put at the front of any object conditions in multi-thread context. PriorityCondition must be put at the tail of condition's list, or there will be some mistake.
Constructor and Description |
---|
PriorityCondition(int priority) |
Modifier and Type | Method and Description |
---|---|
PriorityCondition |
deepClone()
Deep clone this condition
|
static boolean |
exist() |
int |
fetch(Membrane membrane,
int times)
If the highest priority equals to
priority , this rule will fetch. |
int |
getPriority() |
int |
satisfy(Membrane membrane)
Save the highest priority.
|
void |
setPriority(int priority) |
java.lang.String |
toString() |
void |
withdrawFetch(Membrane membrane,
int times)
If some conditions in one rule cannot fetch the objects then the conditions
which have fetched the objects they need withdraw the objects they have
fetched.
|
public static boolean exist()
public PriorityCondition deepClone()
Condition
public int satisfy(Membrane membrane)
public int fetch(Membrane membrane, int times)
priority
, this rule will fetch.public void withdrawFetch(Membrane membrane, int times)
Condition
withdrawFetch
in interface Condition
membrane
- the membrane current condition withdraw objects totimes
- withdraw fetch timespublic int getPriority()
public void setPriority(int priority)
public java.lang.String toString()
toString
in class java.lang.Object