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

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

public class BufferedReaderSugar
extends Object

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

Author:
Mark S. Miller

Constructor Summary
private BufferedReaderSugar()
          prevent instantiation
 
Method Summary
static String getText(BufferedReader self)
          Enabled: Gets the rest of the input as a String (equivalently, bare Twine), normalizing newlines into '\n's.
static Twine getTwine(BufferedReader 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(BufferedReader self, AssocFunc func)
          Enabled: Enumerates lineNumber => String (text line) associations.
static void iterate(BufferedReader self, AssocFunc func, String optURL)
          Enabled: Enumerates lineNumber => String/Twine (text line) associations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferedReaderSugar

private BufferedReaderSugar()
prevent instantiation

Method Detail

iterate

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

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

Throwable

iterate

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

Each text line ends with a "\n". If optURL is null, then each text line will be a String. Otherwise, each will be a Twine with location info.

IOException

getText

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

IOException

getTwine

public static Twine getTwine(BufferedReader 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


comments?