|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.xtreemos.xosd.utilities.logger.filters.NonBlockingTokenFilter
public abstract class NonBlockingTokenFilter
nonblocking filter always forwards the token as soon as possible (the add function must
Field Summary | |
---|---|
protected TokenScatterUnit |
scatter
|
protected java.util.ArrayList<IToken> |
tokens
|
Constructor Summary | |
---|---|
NonBlockingTokenFilter()
|
Method Summary | |
---|---|
void |
add(IToken token)
processes the token and stores it in its proper place in the pipelane |
protected abstract boolean |
checkToken(IToken token)
implement this method to define your filtering criteria |
void |
clearPipe()
removes all elements in the pipe |
TokenScatterUnit |
filters()
returns unit for filter management |
protected void |
insert(IToken token)
the tokens are not organized, new token is added at the end queue |
boolean |
isFinal()
checks if the filter is final or just one in a chain |
void |
markLastToken()
marks the flag, that the last token has been sent to the filter. this matters if the filter is a blocking filter, which needs all tokens before proceeding (blocking filters can be used for sorting elements). |
int |
numTokens()
|
IToken |
topToken()
Returns first elemen of the pipe, but only if there are no filters registered to use them. this function works only for final filters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TokenScatterUnit scatter
protected java.util.ArrayList<IToken> tokens
Constructor Detail |
---|
public NonBlockingTokenFilter()
Method Detail |
---|
public void add(IToken token)
ITokenFilter
add
in interface ITokenFilter
protected void insert(IToken token)
token
- protected abstract boolean checkToken(IToken token)
token
- TODOpublic void clearPipe()
ITokenFilter
clearPipe
in interface ITokenFilter
public TokenScatterUnit filters()
ITokenFilter
filters
in interface ITokenFilter
public boolean isFinal()
ITokenFilter
isFinal
in interface ITokenFilter
public void markLastToken()
ITokenFilter
markLastToken
in interface ITokenFilter
public int numTokens()
numTokens
in interface ITokenFilter
public IToken topToken()
ITokenFilter
topToken
in interface ITokenFilter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |