Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.hsqldb.rowio;
 
 
 public class RowInputTextQuoted extends RowInputText
 {
   private static final int NORMAL_FIELD = 0;
   private static final int NEED_END_QUOTE = 1;
  private static final int FOUND_QUOTE = 2;
  private char[] qtext;
  public RowInputTextQuoted(String paramString1String paramString2String paramString3boolean paramBoolean)
  {
    super(paramString1paramString2paramString3paramBoolean);
  }
  public void setSource(String paramStringint paramInt1int paramInt2)
  {
    super.setSource(paramStringparamInt1paramInt2);
    this. = paramString.toCharArray();
  }
  protected String getField(String paramStringint paramIntboolean paramBoolean)
    throws IOException
  {
    String str = null;
    if ((this. >= this..length) || (this.[this.] != '"'))
      return super.getField(paramStringparamIntparamBoolean);
    try
    {
      this. += 1;
      StringBuffer localStringBuffer = new StringBuffer();
      int i = 0;
      int j = 0;
      int k = -1;
      if (!paramBoolean)
        k = this..indexOf(paramStringthis.);
      while (this. < this..length)
      {
        switch (j)
        {
        case 0:
        default:
          if (this. == k)
          {
            this. += paramInt;
            i = 1;
          }
          else if (this.[this.] == '"')
          {
            j = 1;
          }
          else
          {
            localStringBuffer.append(this.[this.]);
          }
          break;
        case 1:
          if (this.[this.] == '"')
            j = 2;
          else
            localStringBuffer.append(this.[this.]);
          break;
        case 2:
          if (this.[this.] == '"')
          {
            localStringBuffer.append(this.[this.]);
            j = 1;
          }
          else
          {
            this. += paramInt - 1;
            j = 0;
            if (paramBoolean)
              break;
            this. += 1;
            i = 1;
          }
        }
        if (i != 0)
          break;
        this. += 1;
      }
      str = localStringBuffer.toString();
    }
    catch (Exception localException)
    {
      throw new IOException(Trace.getMessage(181, truenew Object[] { new Integer(this.), localException.toString() }));
    }
    return str;
  }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/thirdparty-all.jar
 * Qualified Name:     org.hsqldb.rowio.RowInputTextQuoted
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X