コード例 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public boolean incrementToken() throws java.io.IOException
        public override bool incrementToken()
        {
            if (input.incrementToken())
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final char[] buffer = termAtt.buffer();
                char[] buffer = termAtt.buffer();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int length = termAtt.length();
                int length = termAtt.length();
                for (int i = 0; i < length; i++)
                {
                    if (buffer[i] == delimiter)
                    {
                        payAtt.Payload = encoder.encode(buffer, i + 1, (length - (i + 1)));
                        termAtt.Length = i;   // simply set a new length
                        return(true);
                    }
                }
                // we have not seen the delimiter
                payAtt.Payload = null;
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
 public override bool IncrementToken()
 {
     if (input.IncrementToken())
     {
         char[] buffer = termAtt.Buffer();
         int    length = termAtt.Length;
         for (int i = 0; i < length; i++)
         {
             if (buffer[i] == delimiter)
             {
                 payAtt.Payload = encoder.encode(buffer, i + 1, (length - (i + 1)));
                 termAtt.Length = i; // simply set a new length
                 return(true);
             }
         }
         // we have not seen the delimiter
         payAtt.Payload = null;
         return(true);
     }
     else
     {
         return(false);
     }
 }