Class StringReader

java.lang.Object
java.io.Reader
com.codename1.util.regex.StringReader
All Implemented Interfaces:
AutoCloseable

public class StringReader extends Reader
  • Field Summary

    Fields inherited from class Reader

    lock
    Modifier and Type
    Field
    Description
    protected Object
    The object used to synchronize operations on this stream.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the stream.
    int
    Read a single character.
    int
    read(char[] cbuf, int off, int len)
    Read characters into a portion of an array.
     
    boolean
    Tell whether this stream is ready to be read.

    Methods inherited from class Reader

    mark, markSupported, read, reset, skip
    Modifier and Type
    Method
    Description
    void
    mark(int readAheadLimit)
    Mark the present position in the stream.
    boolean
    Tell whether this stream supports the mark() operation.
    int
    read(char[] cbuf)
    Read characters into an array.
    void
    Reset the stream.
    long
    skip(long n)
    Skip characters.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
     
    boolean
    Indicates whether some other object is "equal to" this one.
    final Class
    Returns the runtime class of an object.
    int
    Returns a hash code value for the object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    Returns a string representation of the object.
    final void
    Causes current thread to wait until another thread invokes the method or the method for this object.
    final void
    wait(long timeout)
    Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
    final void
    wait(long timeout, int nanos)
    Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
  • Constructor Details

    • StringReader

      public StringReader(String str)
  • Method Details

    • read

      public int read()
      Description copied from class: Reader
      Read a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached. Subclasses that intend to support efficient single-character input should override this method.
      Overrides:
      read in class Reader
    • read

      public int read(char[] cbuf, int off, int len)
      Description copied from class: Reader
      Read characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.
      Specified by:
      read in class Reader
    • close

      public void close()
      Description copied from class: Reader
      Close the stream. Once a stream has been closed, further read(), ready(), mark(), or reset() invocations will throw an IOException. Closing a previously-closed stream, however, has no effect.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in class Reader
    • readLine

      public String readLine()
    • ready

      public boolean ready()
      Description copied from class: Reader
      Tell whether this stream is ready to be read.
      Overrides:
      ready in class Reader