|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.livescribe.configuration.Config
public abstract class Config
This class contains utility functions for retrieving and storing typed data. Subclasses can provide the data in any way they see fit.
It is up to the implementation to decide what to do in the following cases:
null,
One strategy may be to throw, for example, a NumberFormatException
if a number is expected, but the value cannot be parsed as a number, and a
NullPointerException if the property name is null. This class,
however, makes no guarantees.
| Field Summary | |
|---|---|
protected static int |
VALUE_BOOLEAN
|
protected static int |
VALUE_DOUBLE
|
protected static int |
VALUE_LONG
|
protected static int |
VALUE_STRING
|
| Constructor Summary | |
|---|---|
Config()
|
|
| Method Summary | |
|---|---|
abstract boolean |
getBooleanValue(String name)
Gets the value of the specified property as a boolean. |
abstract double |
getDoubleValue(String name)
Gets the value of the specified property as a double. |
abstract long |
getLongValue(String name)
Gets the value of the specified property as a long. |
abstract String |
getStringValue(String name)
Gets the value of the specified property as a string. |
abstract void |
setBooleanValue(String name,
boolean value)
Sets the specified property to the given boolean value. |
abstract void |
setDoubleValue(String name,
double value)
Sets the specified property to the given double value. |
abstract void |
setLongValue(String name,
long value)
Sets the specified property to the given long value. |
abstract void |
setStringValue(String name,
String value)
Sets the specified property to the given string value. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int VALUE_LONG
protected static final int VALUE_BOOLEAN
protected static final int VALUE_STRING
protected static final int VALUE_DOUBLE
| Constructor Detail |
|---|
public Config()
| Method Detail |
|---|
public abstract long getLongValue(String name)
long. It
is up to the implementation to decide what to do if the specified
property name is null, if the property does not exist, or
if the value cannot be represented as a long.
name - the property name
long.public abstract boolean getBooleanValue(String name)
boolean. It
is up to the implementation to decide what to do if the specified
property name is null, if the property does not exist, or
if the value cannot be represented as a boolean.
name - the property name
boolean.public abstract String getStringValue(String name)
null, if the property does not exist, or
if the value cannot be represented as a string.
name - the property name
public abstract double getDoubleValue(String name)
double. It
is up to the implementation to decide what to do if the specified
property name is null, if the property does not exist, or
if the value cannot be represented as a double.
name - the property name
double.
public abstract void setLongValue(String name,
long value)
long value. It
is up to the implementation to decide what to do if the specified
property name is null, if the property does not already
exist, or if the value cannot be stored as a long.
name - the property namevalue - set the property to this value
public abstract void setBooleanValue(String name,
boolean value)
boolean value.
It is up to the implementation to decide what to do if the specified
property name is null, if the property does not already
exist, or if the value cannot be stored as a boolean.
name - the property namevalue - set the property to this value
public abstract void setStringValue(String name,
String value)
null, if the property does not already exist, or if the
value cannot be stored as a string.
name - the property namevalue - set the property to this value
public abstract void setDoubleValue(String name,
double value)
double value. It
is up to the implementation to decide what to do if the specified
property name is null, if the property does not already
exist, or if the value cannot be stored as a double.
name - the property namevalue - set the property to this value
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||