org.erights.e.meta.java.lang
Class CharacterSugar

java.lang.Object
  |
  +--org.erights.e.meta.java.lang.CharacterSugar

public class CharacterSugar
extends Object

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

Author:
Mark S. Miller

Constructor Summary
private CharacterSugar()
          prevent instantiation
 
Method Summary
static void __printOn(char self, TextWriter out)
          Enabled: Unlike Java's Writer.print(char), E's chars print by printing their quoted form.
static void add(char self, char other)
          Enabled: Kludge to force overload resolution to prevent a char from successfully Java-coercing, on method.invoke(), to an int.
static char add(char self, int delta)
          Enabled:
static int asInteger(char self)
          Enabled: Unicode character code
static String escaped(char self)
          Enabled: Just the part of a character's quoted form that encodes the character.
static char max(char self, char other)
          Enabled:
static char min(char self, char other)
          Enabled:
static char next(char self)
          Enabled:
static char previous(char self)
          Enabled:
static int subtract(char self, char other)
          Enabled:
static char subtract(char self, int delta)
          Enabled:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharacterSugar

private CharacterSugar()
prevent instantiation

Method Detail

asInteger

public static int asInteger(char self)
Enabled: Unicode character code


add

public static char add(char self,
                       int delta)
Enabled:


add

public static void add(char self,
                       char other)
Enabled: Kludge to force overload resolution to prevent a char from successfully Java-coercing, on method.invoke(), to an int.


subtract

public static char subtract(char self,
                            int delta)
Enabled:


subtract

public static int subtract(char self,
                           char other)
Enabled:


next

public static char next(char self)
Enabled:


previous

public static char previous(char self)
Enabled:


min

public static char min(char self,
                       char other)
Enabled:


max

public static char max(char self,
                       char other)
Enabled:


__printOn

public static void __printOn(char self,
                             TextWriter out)
                      throws IOException
Enabled: Unlike Java's Writer.print(char), E's chars print by printing their quoted form.

If you want to contribute the character itself to a TextWriter, print it by doing out print(""+c)

IOException

escaped

public static String escaped(char self)
Enabled: Just the part of a character's quoted form that encodes the character.

In other words, everything except the enclosing quote signs. This is used for composing a quoted character. It is mostly redundant with org.erights.e.elib.tables.Twine#quote and org.erights.e.develop.format.StringHelper#quote, but this one outputs a backslash-en for a newline, rather than the newline itself.



comments?