|
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.Object org.jcsp.lang.ChannelOutputWrapper org.jcsp.util.filter.FilteredSharedChannelOutputWrapper
public class FilteredSharedChannelOutputWrapper
This is wrapper for a SharedChannelOutput
that adds
write filtering. Instances of this class can be safely used by
multiple concurrent processes.
Constructor Summary | |
---|---|
FilteredSharedChannelOutputWrapper(SharedChannelOutput out)
Constructs a new wrapper for the given channel output end. |
Method Summary | |
---|---|
void |
addWriteFilter(Filter filter)
Installs a write filter defining a transformation to be applied by the write method of
the channel end. |
void |
addWriteFilter(Filter filter,
int index)
Installs a write filter defining a transformation to be applied by the write method of the
channel end at a specific index. |
Filter |
getWriteFilter(int index)
Returns the write filter installed at the given index. |
int |
getWriteFilterCount()
Returns the number of write filters currently installed. |
void |
removeWriteFilter(Filter filter)
Removes the first write filter (lowest index) matching the filter given as a parameter. |
void |
removeWriteFilter(int index)
Removes the write filter installed at the given index. |
void |
write(Object data)
Writes a value to the channel. |
Methods inherited from class org.jcsp.lang.ChannelOutputWrapper |
---|
poison |
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.Poisonable |
---|
poison |
Methods inherited from interface org.jcsp.lang.Poisonable |
---|
poison |
Constructor Detail |
---|
public FilteredSharedChannelOutputWrapper(SharedChannelOutput out)
out
- the existing channel end.Method Detail |
---|
public void write(Object data)
ChannelOutputWrapper
write
in interface ChannelOutput
data
- the value to write.ChannelOutput
public void addWriteFilter(Filter filter)
WriteFiltered
write
method of
the channel end. The filter will be appended to the end of the current list, making it the last to
be applied.
addWriteFilter
in interface WriteFiltered
filter
- the filter to be installed; may not be null.public void addWriteFilter(Filter filter, int index)
WriteFiltered
write
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.
addWriteFilter
in interface WriteFiltered
filter
- the filter to be installed; may not be null.index
- the zero based index; may not be negative.public void removeWriteFilter(Filter filter)
WriteFiltered
r
, will satisfy the condition r.equals (filter)
. The remaining
filters are shifted to close the gap in the index allocation.
removeWriteFilter
in interface WriteFiltered
filter
- the filter to be removed; may not be null.public void removeWriteFilter(int index)
WriteFiltered
removeWriteFilter
in interface WriteFiltered
index
- zero-based index of the filter to be removed.public Filter getWriteFilter(int index)
WriteFiltered
getWriteFilter
in interface WriteFiltered
index
- zero-based index of the filter to return.
public int getWriteFilterCount()
WriteFiltered
getWriteFilterCount
in interface WriteFiltered
|
CSP for Java (JCSP) 1.1-rc4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |