FileDocCategorySizeDatePackage
ParserCursor.javaAPI DocAndroid 1.5 API3351Wed May 06 22:41:10 BST 2009org.apache.http.message

ParserCursor

public class ParserCursor extends Object
This class represents a context of a parsing operation:
  • the current position the parsing operation is expected to start at
  • the bounds limiting the scope of the parsing operation
author
Oleg Kalnichevski

Fields Summary
private final int
lowerBound
private final int
upperBound
private int
pos
Constructors Summary
public ParserCursor(int lowerBound, int upperBound)

        super();
        if (lowerBound < 0) {
            throw new IndexOutOfBoundsException("Lower bound cannot be negative");
        }
        if (lowerBound > upperBound) {
            throw new IndexOutOfBoundsException("Lower bound cannot be greater then upper bound");
        }
        this.lowerBound = lowerBound;
        this.upperBound = upperBound;
        this.pos = lowerBound;
    
Methods Summary
public booleanatEnd()

        return this.pos >= this.upperBound;
    
public intgetLowerBound()

        return this.lowerBound;
    
public intgetPos()

        return this.pos;
    
public intgetUpperBound()

        return this.upperBound;
    
public java.lang.StringtoString()

        CharArrayBuffer buffer = new CharArrayBuffer(16);
        buffer.append('[");
        buffer.append(Integer.toString(this.lowerBound));
        buffer.append('>");
        buffer.append(Integer.toString(this.pos));
        buffer.append('>");
        buffer.append(Integer.toString(this.upperBound));
        buffer.append(']");
        return buffer.toString();
    
public voidupdatePos(int pos)

        if (pos < this.lowerBound) {
            throw new IndexOutOfBoundsException();
        }
        if (pos > this.upperBound) {
            throw new IndexOutOfBoundsException();
        }
        this.pos = pos;