|
CSP for Java (JCSP) 1.1-rc4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jcsp.lang.Guard
org.jcsp.lang.AltingChannelInput
org.jcsp.lang.AltingChannelInputWrapper
org.jcsp.util.filter.FilteredAltingChannelInput
public class FilteredAltingChannelInput
Implements an AltingChannelInput
channel end that also supports read filters.
AltingChannelInput
,
ReadFiltered
Method Summary | |
---|---|
void |
addReadFilter(Filter filter)
Installs a read filter defining a transformation to be applied by the read method of the
channel end. |
void |
addReadFilter(Filter filter,
int index)
Installs a read filter defining a transformation to be applied by the read method of the
channel end at a specific index. |
Filter |
getReadFilter(int index)
Returns the read filter installed at the given index. |
int |
getReadFilterCount()
Returns the number of read filters currently installed. |
Object |
read()
Read an Object from the channel. |
void |
removeReadFilter(Filter filter)
Removes the first read filter (lowest index) matching the filter given as a parameter. |
void |
removeReadFilter(int index)
Removes the read filter installed at the given index. |
Methods inherited from class org.jcsp.lang.AltingChannelInputWrapper |
---|
endRead, getChannel, pending, poison, setChannel, startRead |
Methods inherited from class org.jcsp.lang.Guard |
---|
schedule |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jcsp.lang.ChannelInput |
---|
endRead, startRead |
Methods inherited from interface org.jcsp.lang.Poisonable |
---|
poison |
Method Detail |
---|
public Object read()
AltingChannelInputWrapper
read
in interface ChannelInput
read
in class AltingChannelInputWrapper
public void addReadFilter(Filter filter)
ReadFiltered
read
method of the
channel end. The filter will be appended to the end of the current list, making it the last to
be applied.
addReadFilter
in interface ReadFiltered
filter
- the filter to be installed; may not be null.public void addReadFilter(Filter filter, int index)
ReadFiltered
read
method of the
channel end at a specific index. If there is already a filter at that index position the existing
filters are shifted to make room. If the index is greater than the number of filters already
installed the filter is placed at the end.
addReadFilter
in interface ReadFiltered
filter
- the filter to be installed; may not be null.index
- the zero based index; may not be negative.public void removeReadFilter(Filter filter)
ReadFiltered
r
, will satisfy the condition r.equals (filter)
. The remaining
filters are shifted to close the gap in the index allocation.
removeReadFilter
in interface ReadFiltered
filter
- the filter to be removed; may not be null.public void removeReadFilter(int index)
ReadFiltered
removeReadFilter
in interface ReadFiltered
index
- zero-based index of the filter to be removed.public Filter getReadFilter(int index)
ReadFiltered
getReadFilter
in interface ReadFiltered
index
- zero-based index of the filter to return.
public int getReadFilterCount()
ReadFiltered
getReadFilterCount
in interface ReadFiltered
|
CSP for Java (JCSP) 1.1-rc4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |