org.z3950.zing.cql
Class PositionAwareReader

java.lang.Object
  extended by java.io.Reader
      extended by org.z3950.zing.cql.PositionAwareReader
All Implemented Interfaces:
Closeable, Readable

public class PositionAwareReader
extends Reader

Reader proxy to count how many characters has been read so far.

Author:
jakub

Field Summary
protected  int pos
           
protected  Reader reader
           
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
PositionAwareReader(Reader reader)
           
 
Method Summary
 void close()
           
 boolean equals(Object obj)
           
 int getPosition()
           
 int hashCode()
           
 void mark(int readAheadLimit)
           
 boolean markSupported()
           
 int read()
           
 int read(char[] cbuf)
           
 int read(char[] cbuf, int off, int len)
           
 int read(CharBuffer target)
           
 boolean ready()
           
 void reset()
           
 long skip(long n)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

reader

protected Reader reader

pos

protected int pos
Constructor Detail

PositionAwareReader

public PositionAwareReader(Reader reader)
Method Detail

getPosition

public int getPosition()

mark

public void mark(int readAheadLimit)
          throws IOException
Overrides:
mark in class Reader
Throws:
IOException

markSupported

public boolean markSupported()
Overrides:
markSupported in class Reader

read

public int read()
         throws IOException
Overrides:
read in class Reader
Throws:
IOException

read

public int read(char[] cbuf)
         throws IOException
Overrides:
read in class Reader
Throws:
IOException

read

public int read(CharBuffer target)
         throws IOException
Specified by:
read in interface Readable
Overrides:
read in class Reader
Throws:
IOException

read

public int read(char[] cbuf,
                int off,
                int len)
         throws IOException
Specified by:
read in class Reader
Throws:
IOException

ready

public boolean ready()
              throws IOException
Overrides:
ready in class Reader
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class Reader
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Reader
Throws:
IOException

reset

public void reset()
           throws IOException
Overrides:
reset in class Reader
Throws:
IOException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2008-2013 Index Data. All Rights Reserved.