|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zmpp.vmutil.ZsciiConverter
public class ZsciiConverter
This class provides conversion for the ZSCII character encoding into the Java character system.
Nested Class Summary | |
---|---|
static interface |
ZsciiConverter.AbbreviationsTable
This interface defines the abstract access to an abbreviations table in memory, this will be used for decoding if needed. |
static class |
ZsciiConverter.Alphabet
Defines the possible alphabets here. |
Field Summary | |
---|---|
static String |
A0CHARS
|
static String |
A1CHARS
|
static String |
A2CHARS
|
static byte |
CHAR_0
|
static byte |
CHAR_1
|
static byte |
CHAR_6
|
static byte |
SHIFT_2
|
static byte |
SHIFT_3
|
static byte |
SHIFT_4
|
static byte |
SHIFT_5
|
Constructor Summary | |
---|---|
ZsciiConverter(int version,
ZsciiConverter.AbbreviationsTable abbreviations)
Constructor. |
Method Summary | |
---|---|
String |
convert(MemoryReadAccess memaccess,
int address)
Performs a ZSCII to Unicode conversion at the specified position of the given memory object. |
static char |
decode(ZsciiConverter.Alphabet alphabet,
short zchar)
Decodes a printable character to a unicode character. |
static void |
decodeZchar(StringBuilder builder,
ZsciiConverter.Alphabet alphabet,
byte b)
Decodes the given byte value to the specified buffer using the working alphabet. |
ZsciiConverter.Alphabet |
getInitialAlphabet()
Returns the initial alphabet of this converter. |
int |
getVersion()
Returns the story file version. |
static ZsciiConverter.Alphabet |
shiftFrom(ZsciiConverter.Alphabet alphabet,
byte shiftChar)
Returns a new alphabet for a given shift character. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte CHAR_0
public static final byte CHAR_1
public static final byte SHIFT_2
public static final byte SHIFT_3
public static final byte SHIFT_4
public static final byte SHIFT_5
public static final byte CHAR_6
public static final String A0CHARS
public static final String A1CHARS
public static final String A2CHARS
Constructor Detail |
---|
public ZsciiConverter(int version, ZsciiConverter.AbbreviationsTable abbreviations)
version
- Story file versionabbreviations
- the abbreviations table used for decodingMethod Detail |
---|
public ZsciiConverter.Alphabet getInitialAlphabet()
public int getVersion()
public String convert(MemoryReadAccess memaccess, int address)
memaccess
- a MemoryReadAccess objectaddress
- the address of a ZSCII string
public static void decodeZchar(StringBuilder builder, ZsciiConverter.Alphabet alphabet, byte b)
builder
- the buffer to print intoalphabet
- the working alphabetb
- a z character, needs to be a non-shift characterpublic static char decode(ZsciiConverter.Alphabet alphabet, short zchar)
alphabet
- the work alphabetzchar
- the ZSCII character to decode
public static ZsciiConverter.Alphabet shiftFrom(ZsciiConverter.Alphabet alphabet, byte shiftChar)
alphabet
- the start alphabetshiftChar
- the shift character
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |