org.mmtk.vm
Class Strings

java.lang.Object
  extended by org.mmtk.vm.Strings
Direct Known Subclasses:
Strings

public abstract class Strings
extends Object


Constructor Summary
Strings()
           
 
Method Summary
abstract  int copyStringToChars(String src, char[] dst, int dstBegin, int dstEnd)
          Copies characters from the string into the character array.
abstract  void write(char[] c, int len)
          Log a message.
abstract  void writeThreadId(char[] c, int len)
          Log a thread identifier and a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Strings

public Strings()
Method Detail

write

public abstract void write(char[] c,
                           int len)
Log a message.

Parameters:
c - character array with message starting at index 0
len - number of characters in message

writeThreadId

public abstract void writeThreadId(char[] c,
                                   int len)
Log a thread identifier and a message.

Parameters:
c - character array with message starting at index 0
len - number of characters in message

copyStringToChars

public abstract int copyStringToChars(String src,
                                      char[] dst,
                                      int dstBegin,
                                      int dstEnd)
Copies characters from the string into the character array. Thread switching is disabled during this method's execution.

TODO: There are special memory management semantics here that someone should document.

Parameters:
src - the source string
dst - the destination array
dstBegin - the start offset in the destination array
dstEnd - the index after the last character in the destination to copy to
Returns:
the number of characters copied.