Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void test() throws java.io.IOException
        public virtual void test()
        {
            Token token = new Token();
            SingleTokenTokenStream ts       = new SingleTokenTokenStream(token);
            AttributeImpl          tokenAtt = (AttributeImpl)ts.addAttribute(typeof(CharTermAttribute));

            assertTrue(tokenAtt is Token);
            ts.reset();

            assertTrue(ts.incrementToken());
            assertEquals(token, tokenAtt);
            assertFalse(ts.incrementToken());

            token    = new Token("hallo", 10, 20, "someType");
            ts.Token = token;
            ts.reset();

            assertTrue(ts.incrementToken());
            assertEquals(token, tokenAtt);
            assertFalse(ts.incrementToken());
        }
            public override void copyTo(AttributeImpl target)
            {
                MockRetainAttribute t = (MockRetainAttribute)target;

                t.Retain = retain;
            }
 public override void copyTo(AttributeImpl target)
 {
     MockRetainAttribute t = (MockRetainAttribute) target;
       t.Retain = retain;
 }