edu.rice.cs.util
Class ReaderWriterLockTest.PrintCommand

java.lang.Object
  extended by edu.rice.cs.util.ReaderWriterLockTest.PrintCommand
Enclosing class:
ReaderWriterLockTest

public class ReaderWriterLockTest.PrintCommand
extends Object

Command pattern class to print to a buffer.


Field Summary
(package private)  StringBuffer _buf
          Buffer to print to
(package private)  String _msg
          Message to print
(package private)  int _numIterations
          Number of times to print
(package private)  int _waitMillis
          Number of milliseconds to wait between iterations
 
Constructor Summary
ReaderWriterLockTest.PrintCommand(String msg, StringBuffer buf)
          Creates a new command to print to a buffer during a read or write.
 
Method Summary
 void print()
          Prints the message to the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_numIterations

volatile int _numIterations
Number of times to print


_waitMillis

volatile int _waitMillis
Number of milliseconds to wait between iterations


_buf

final StringBuffer _buf
Buffer to print to


_msg

final String _msg
Message to print

Constructor Detail

ReaderWriterLockTest.PrintCommand

public ReaderWriterLockTest.PrintCommand(String msg,
                                         StringBuffer buf)
Creates a new command to print to a buffer during a read or write.

Method Detail

print

public void print()
Prints the message to the buffer.