|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsinclair.basic.ZX81Translate
This class provides utilities to translate between ZX81 character set and ASCII.
Field Summary | |
---|---|
static int |
TOKEN_NEWLINE
The index of the new line token. |
static int |
TOKEN_NUMBER
The index of the number indicator token. |
static int |
TOKEN_REM
The index of the REM token. |
Constructor Summary | |
---|---|
ZX81Translate()
|
Method Summary | |
---|---|
static boolean |
checkTranslatableToZX81(java.lang.String str)
Check that the given string contains valid characters. |
static java.lang.String |
expandZX81(int c)
Expand the given ZX81 character into a string of ZX81 characters. |
static void |
main(java.lang.String[] args)
Main routine. |
static int |
translateASCIIToZX81(char value)
Translate an ASCII character to ZX81. |
static void |
translateASCIIToZX81(java.lang.String value,
java.lang.StringBuffer trans)
Translate an ASCII string to ZX81. |
static java.lang.String |
translateZX81ToASCII(java.io.InputStream is)
Translate the bytes from the stream from ZX81 characters to ASCII. |
static java.lang.String |
translateZX81ToASCII(int value)
Translate a ZX81 character to ASCII. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TOKEN_NUMBER
public static final int TOKEN_NEWLINE
public static final int TOKEN_REM
Constructor Detail |
public ZX81Translate()
Method Detail |
public static void main(java.lang.String[] args)
Translates a file and writes to standard output. Arguments:
{-pFile|-p} fileName The name of the .P file.
args
- The arguments.public static java.lang.String translateZX81ToASCII(int value)
value
- The ZX81 character value.
public static int translateASCIIToZX81(char value)
This version translates a single character - i.e. it will not map keywords back to the ZX81 character.
Returns -1 if the character does not exist in the ZX81 set.
value
- The ASCII character value.
public static void translateASCIIToZX81(java.lang.String value, java.lang.StringBuffer trans)
This version translates each single character - i.e. it will not map keywords back to the ZX81 character.
Returns -1 if the character does not exist in the ZX81 set.
value
- The ASCII string.trans
- A buffer to hold the translated string.public static java.lang.String translateZX81ToASCII(java.io.InputStream is) throws java.io.IOException
is
- The input stream to be read.
java.io.IOException
- An error occurred reading the stream.public static java.lang.String expandZX81(int c)
c
- The ZX81 character.
public static boolean checkTranslatableToZX81(java.lang.String str)
str
-
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |