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

NameRepository

public class NameRepository extends Object

Fields Summary
private Vector
_names
private int
_numberOfNames
Constructors Summary
public NameRepository(int numberOfNames)

        _numberOfNames = numberOfNames;
        _names = new Vector(_numberOfNames);
        for (int counter = 0; counter < _numberOfNames; counter++) {
            _names.add("Customer number " + counter);
        }
    
Methods Summary
public java.lang.StringgetAName()

        int index = (int) (Math.random() * _numberOfNames);

        return (String) _names.get(index);
    
public java.util.IteratorgetAllNames()

        synchronized (_names) {
            return _names.iterator();
        }