FileDocCategorySizeDatePackage
TestResultHolder.javaAPI DocExample1238Thu Nov 08 00:22:48 GMT 2001com.ora.rmibook.chapter13.bank.applications

TestResultHolder

public class TestResultHolder extends Object

Fields Summary
private Hashtable
_resultsTable
private Vector
_accountNames
Constructors Summary
public TestResultHolder()

        _resultsTable = new Hashtable();
        _accountNames = new Vector();
    
Methods Summary
public voidaddResult(Test test)

        Vector resultsVector = (Vector) _resultsTable.get(test.accountName);

        if (null == resultsVector) {
            resultsVector = new Vector();
            _resultsTable.put(test.accountName, resultsVector);
            _accountNames.add(test.accountName);
        }
        resultsVector.add(test);
    
public java.util.CollectiongetAccountNames()

        return _accountNames;
    
public java.util.CollectiongetResultsForAccount(java.lang.String accountName)

        return (Collection) _resultsTable.get(accountName);
    
public voidsortResults()

        Collections.sort(_accountNames);
        Iterator valueVectors = (_resultsTable.values()).iterator();

        while (valueVectors.hasNext()) {
            Vector nextVector = (Vector) valueVectors.next();

            Collections.sort(nextVector);
        }
        return;