org.erights.e.meta.java.io
Class ReaderSugar

java.lang.Object
  |
  +--org.erights.e.meta.java.io.ReaderSugar

public class ReaderSugar
extends Object

Untamed: A sweetener defining extra messages that may be e-sent to a Reader.

Author:
Mark S. Miller

Constructor Summary
private ReaderSugar()
          prevent instantiation
 
Method Summary
static String getText(Reader self)
          Enabled: Gets the rest of the input as a String, normalizing newlines into '\n's.
static Twine getTwine(Reader self, String url)
          Enabled: Gets the contents of the url as Twine (a text string that remembers where it came from), normalizing newlines into '\n's.
static void iterate(Reader self, AssocFunc func)
          Enabled: Enumerates lineNumber => String (text line) associations.
static void iterate(Reader self, AssocFunc func, String optURL)
          Enabled: Enumerates lineNumber => String/Twine (text line) associations.
static Character readChar(Reader self)
          Enabled: Returns the next character, or null at end of file.
static String readString(Reader self, int size)
          Enabled: Reads no more than 'size' characters from the file, and return them as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReaderSugar

private ReaderSugar()
prevent instantiation

Method Detail

iterate

public static void iterate(Reader self,
                           AssocFunc func)
                    throws IOException
Enabled: Enumerates lineNumber => String (text line) associations.

Each text line ends with a "\n". optURL defaults to null.

IOException

iterate

public static void iterate(Reader self,
                           AssocFunc func,
                           String optURL)
                    throws IOException
Enabled: Enumerates lineNumber => String/Twine (text line) associations.

Each text line ends with a "\n".

IOException

getText

public static String getText(Reader self)
                      throws IOException
Enabled: Gets the rest of the input as a String, normalizing newlines into '\n's.

IOException

getTwine

public static Twine getTwine(Reader self,
                             String url)
                      throws IOException
Enabled: Gets the contents of the url as Twine (a text string that remembers where it came from), normalizing newlines into '\n's.

IOException

readChar

public static Character readChar(Reader self)
                          throws IOException
Enabled: Returns the next character, or null at end of file.

IOException

readString

public static String readString(Reader self,
                                int size)
                         throws IOException
Enabled: Reads no more than 'size' characters from the file, and return them as a String. If at end-of-file, return null.

IOException


comments?