Class FilteredAltingChannelInput

    • Field Detail

      • filters

        private FilterHolder filters
        Holds the filters installed for the read end of this channel.
    • Constructor Detail

      • FilteredAltingChannelInput

        FilteredAltingChannelInput​(AltingChannelInput altingChannelInput)
        Constructs a new channel end that supports filtering by wrapping up an existing channel end.
        Parameters:
        altingChannelInput - the existing channel end.
    • Method Detail

      • addReadFilter

        public void addReadFilter​(Filter filter)
        Description copied from interface: ReadFiltered
        Installs a read filter defining a transformation to be applied by the 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.
        Specified by:
        addReadFilter in interface ReadFiltered
        Parameters:
        filter - the filter to be installed; may not be null.
      • addReadFilter

        public void addReadFilter​(Filter filter,
                                  int index)
        Description copied from interface: ReadFiltered
        Installs a read filter defining a transformation to be applied by the 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.
        Specified by:
        addReadFilter in interface ReadFiltered
        Parameters:
        filter - the filter to be installed; may not be null.
        index - the zero based index; may not be negative.
      • removeReadFilter

        public void removeReadFilter​(Filter filter)
        Description copied from interface: ReadFiltered
        Removes the first read filter (lowest index) matching the filter given as a parameter. The filter removed, r, will satisfy the condition r.equals (filter). The remaining filters are shifted to close the gap in the index allocation.
        Specified by:
        removeReadFilter in interface ReadFiltered
        Parameters:
        filter - the filter to be removed; may not be null.
      • removeReadFilter

        public void removeReadFilter​(int index)
        Description copied from interface: ReadFiltered
        Removes the read filter installed at the given index. The remaining filters are shifted to close the gap in the index allocation.
        Specified by:
        removeReadFilter in interface ReadFiltered
        Parameters:
        index - zero-based index of the filter to be removed.
      • getReadFilter

        public Filter getReadFilter​(int index)
        Description copied from interface: ReadFiltered
        Returns the read filter installed at the given index.
        Specified by:
        getReadFilter in interface ReadFiltered
        Parameters:
        index - zero-based index of the filter to return.
        Returns:
        the filter at that position.
      • getReadFilterCount

        public int getReadFilterCount()
        Description copied from interface: ReadFiltered
        Returns the number of read filters currently installed.
        Specified by:
        getReadFilterCount in interface ReadFiltered