org.zmpp.vmutil
Class ZsciiString

java.lang.Object
  extended by org.zmpp.vmutil.ZsciiString

public class ZsciiString
extends Object

This class represents a string of Z characters. It also does some conversion in case a string is specified as a constructor argument.

Version:
1.0
Author:
Wei-ju Wu

Constructor Summary
ZsciiString(MemoryReadAccess memaccess, int startAddress)
          Constructor.
ZsciiString(short zchar)
          Creates a ZsciiString from a single zchar.
ZsciiString(String str)
          Constructor.
 
Method Summary
 boolean equals(Object o)
          
 MemoryReadAccess getMemoryAccess()
          Returns a memory access object.
 int getNumWords()
          Returns the total number of Zwords occupied by this ZsciiString.
 int getStartAddress()
          Returns the start address within the memory access buffer.
static void setZsciiConverter(ZsciiConverter converter)
          Sets the converter object used by the ZsciiString class.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ZsciiString

public ZsciiString(String str)
Constructor. Creates a ZsciiString from a string.

Parameters:
str - a Java string object

ZsciiString

public ZsciiString(MemoryReadAccess memaccess,
                   int startAddress)
Constructor. Creates a ZsciiString sharing data that lies at the specified position in memory.

Parameters:
memaccess - a memory access object
startAddress - the start address within the memory access object

ZsciiString

public ZsciiString(short zchar)
Creates a ZsciiString from a single zchar.

Parameters:
zchar - a ZSCII char
Method Detail

setZsciiConverter

public static void setZsciiConverter(ZsciiConverter converter)
Sets the converter object used by the ZsciiString class.

Parameters:
converter - the converter

getMemoryAccess

public MemoryReadAccess getMemoryAccess()
Returns a memory access object.

Returns:
the memory access object

getStartAddress

public int getStartAddress()
Returns the start address within the memory access buffer.

Returns:
the start address in the memory access object

getNumWords

public int getNumWords()
Returns the total number of Zwords occupied by this ZsciiString.

Returns:
the numbe of 16-bit words

equals

public boolean equals(Object o)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2005 . All Rights Reserved.