Exemplo n.º 1
0
        /// <summary>
        /// Adds a <seealso cref="SinkTokenStream"/> created by another <code>TeeSinkTokenFilter</code>
        /// to this one. The supplied stream will also receive all consumed tokens.
        /// This method can be used to pass tokens from two different tees to one sink.
        /// </summary>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void addSinkTokenStream(final SinkTokenStream sink)
        public void addSinkTokenStream(SinkTokenStream sink)
        {
            // check that sink has correct factory
            if (!this.AttributeFactory.Equals(sink.AttributeFactory))
            {
                throw new System.ArgumentException("The supplied sink is not compatible to this tee");
            }
            // add eventually missing attribute impls to the existing sink
            for (IEnumerator <AttributeImpl> it = this.cloneAttributes().AttributeImplsIterator; it.MoveNext();)
            {
                sink.addAttributeImpl(it.Current);
            }
            this.sinks.Add(new WeakReference <>(sink));
        }
Exemplo n.º 2
0
	  /// <summary>
	  /// Adds a <seealso cref="SinkTokenStream"/> created by another <code>TeeSinkTokenFilter</code>
	  /// to this one. The supplied stream will also receive all consumed tokens.
	  /// This method can be used to pass tokens from two different tees to one sink.
	  /// </summary>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void addSinkTokenStream(final SinkTokenStream sink)
	  public void addSinkTokenStream(SinkTokenStream sink)
	  {
		// check that sink has correct factory
		if (!this.AttributeFactory.Equals(sink.AttributeFactory))
		{
		  throw new System.ArgumentException("The supplied sink is not compatible to this tee");
		}
		// add eventually missing attribute impls to the existing sink
		for (IEnumerator<AttributeImpl> it = this.cloneAttributes().AttributeImplsIterator; it.MoveNext();)
		{
		  sink.addAttributeImpl(it.Current);
		}
		this.sinks.Add(new WeakReference<>(sink));
	  }