Methods Summary |
---|
java.lang.String | getHostname()
return hostname;
|
java.lang.String | getName()
return name;
|
int | getNumCards()
return numCards;
|
long | getSeed()
return seed;
|
boolean | getShouldBeep()
return shouldBeep;
|
protected void | setDefaults(java.util.Properties defaults)
defaults.put(shouldBeepName, new Boolean(shouldBeep).toString());
defaults.put(nameName, name);
defaults.put(hostnameName, hostname);
defaults.put(numCardsName, new Integer(numCards).toString());
|
void | setHostname(java.lang.String hostname)
this.hostname = hostname;
saveParameters();
|
void | setName(java.lang.String name)
this.name = name;
saveParameters();
|
void | setNames(java.lang.String name, java.lang.String hostname)
this.name = name;
this.hostname = hostname;
saveParameters();
|
void | setNumCards(int numCards)
this.numCards = numCards;
saveParameters();
|
void | setSeed(long seed)
this.seed = seed;
|
void | setShouldBeep(boolean shouldBeep)
this.shouldBeep = shouldBeep;
saveParameters();
|
public java.lang.String | toString()
return "["
+ shouldBeep + ","
+ name + ","
+ hostname + ","
+ numCards + "]";
|
protected void | updatePropertiesFromSettings()
properties.put(shouldBeepName,
new Boolean(shouldBeep).toString());
properties.put(nameName,
name);
properties.put(hostnameName,
hostname);
properties.put(numCardsName,
new Integer(numCards).toString());
|
protected void | updateSettingsFromProperties()
try {
String tmp;
tmp = properties.getProperty(shouldBeepName);
shouldBeep = new Boolean(tmp).booleanValue();
name = properties.getProperty(nameName);
hostname = properties.getProperty(hostnameName);
tmp = properties.getProperty(numCardsName);
numCards = Integer.parseInt(tmp);
} catch (NumberFormatException e) {
// we don't care if the property was of the wrong format,
// they've all got default values. So catch the exception
// and keep going.
}
|