Esempio n. 1
0
        public override bool IncrementToken()
        {
            if (input.IncrementToken())
            {
                // capture state lazily - maybe no SinkFilter accepts this state
                AttributeSource.State state = null;
                for (System.Collections.IEnumerator it = sinks.GetEnumerator(); it.MoveNext();)
                {
                    SinkTokenStream sink = (SinkTokenStream)((System.WeakReference)it.Current).Target;
                    if (sink != null)
                    {
                        if (sink.Accept(this))
                        {
                            if (state == null)
                            {
                                state = this.CaptureState();
                            }
                            sink.AddState(state);
                        }
                    }
                }
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
 internal /*private*/ void  AddState(AttributeSource.State state)
 {
     if (it != null)
     {
         throw new System.SystemException("The tee must be consumed before sinks are consumed.");
     }
     cachedStates.Add(state);
 }
Esempio n. 3
0
 private void  FillCache()
 {
     while (input.IncrementToken())
     {
         cache.Add(CaptureState());
     }
     // capture final state
     input.End();
     finalState = CaptureState();
 }
Esempio n. 4
0
 public override void  End()
 {
     base.End();
     AttributeSource.State finalState = CaptureState();
     for (System.Collections.IEnumerator it = sinks.GetEnumerator(); it.MoveNext();)
     {
         SinkTokenStream sink = (SinkTokenStream)((System.WeakReference)it.Current).Target;
         if (sink != null)
         {
             sink.SetFinalState(finalState);
         }
     }
 }
Esempio n. 5
0
            public override bool IncrementToken()
            {
                // lazy init the iterator
                if (it == null)
                {
                    it = cachedStates.GetEnumerator();
                }

                if (!it.MoveNext())
                {
                    return(false);
                }

                AttributeSource.State state = (State)it.Current;
                RestoreState(state);
                return(true);
            }
Esempio n. 6
0
		private void  FillCache()
		{
			while (input.IncrementToken())
			{
				cache.Add(CaptureState());
			}
			// capture final state
			input.End();
			finalState = CaptureState();
		}
Esempio n. 7
0
			internal /*private*/ void  SetFinalState(AttributeSource.State finalState)
			{
				this.finalState = finalState;
			}
Esempio n. 8
0
 internal /*private*/ void  SetFinalState(AttributeSource.State finalState)
 {
     this.finalState = finalState;
 }