|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.pvccommon.util.DatabaseSection
A DatabaseSection is a major group within a Database
. Each DatabaseSection
is a Properties object, with the methods of that class along with some utility
methods to make using it easier for different kinds of data. These convenience methods
include "get" methods that take a default value, so that the get is ensured to return
a usable value. This avoids the need to check for null values after get calls.
Field Summary | |
protected static java.lang.String |
CHANGED_SINCE_STARTUP
|
static java.lang.String |
COPYRIGHT
IBM copyright information. |
protected static java.lang.String |
NEWVALUE
|
protected static java.lang.String |
REMOVED
|
protected static java.lang.String |
STATUS
|
protected static java.lang.String |
STORED
|
Method Summary | |
void |
clear()
Clear the attributes |
boolean |
exists(java.lang.String key)
Queries database to see if key exists under the passed major group. |
boolean |
getBooleanValue(java.lang.String key)
Get the value associated with the specified key (within the major key grouping). |
boolean |
getBooleanValue(java.lang.String key,
boolean defaultValue)
Get the value associated with the specified key (within the major key grouping). |
double |
getDoubleValue(java.lang.String key)
Get the value associated with the specified key (within the major key grouping). |
double |
getDoubleValue(java.lang.String key,
double defaultValue)
Get the value associated with the specified key (within the major key grouping). |
int |
getIntegerValue(java.lang.String key)
Get the value associated with the specified key (within the major key grouping). |
int |
getIntegerValue(java.lang.String key,
int defaultValue)
Get the value associated with the specified key (within the major key grouping). |
protected java.lang.String |
getInvisibleValue(java.lang.String thisKey)
Get the value of one of the attributes of this section that is used to control database updates, and is not supposed to be visible in the persistently stored version of the DatabaseSection. |
java.lang.String |
getName()
Get the name of this major section. |
java.lang.Object |
getObjectValue(java.lang.String key)
Get the value associated with the specified key (within the major key grouping). |
java.lang.Object |
getObjectValue(java.lang.String key,
java.lang.Object defaultValue)
Get the value associated with the specified key (within the major key grouping). |
java.lang.String |
getStatus()
Print out a string form of section. |
java.lang.String |
getValue(java.lang.String key)
Get the String value associated with the specified key within the DatabaseSection. |
java.lang.String |
getValue(java.lang.String key,
java.lang.String defaultValue)
Get the value associated with the specified key (within the major key grouping). |
boolean |
isCoalesced(java.lang.String key)
Answer whether the value for the given key is coalesced (i.e. |
java.util.Enumeration |
keys()
Answers the set of keys. |
void |
list(java.io.PrintWriter writer)
List (print) out the attributes. |
void |
load(java.io.InputStream inbuf)
Load the section from the given input stream. |
java.util.Enumeration |
propertyNames()
Answer the property names in this section. |
protected void |
removeInvisibleValue(java.lang.String thisKey)
Remove the value of one of the attributes of this section that is used to control database updates, and is not supposed to be visible in the persistently stored version of the DatabaseSection. |
void |
removeValue(java.lang.String key)
Removes the value with the specified key. |
void |
save(java.io.OutputStream outbuf,
java.lang.String sectionName)
Save the section with the given name to the given output stream. |
void |
setBooleanValue(java.lang.String key,
boolean value)
Sets the specified key equal to the passed boolean value. |
void |
setDoubleValue(java.lang.String key,
double value)
Sets the specified key equal to the passed double value. |
void |
setIntegerValue(java.lang.String key,
int value)
Sets the specified key equal to the passed value. |
protected void |
setInvisibleValue(java.lang.String thisKey,
java.lang.String thisValue)
Set the value of one of the attributes of this section that is used to control database updates, and is not supposed to be visible in the persistently stored version of the DatabaseSection. |
void |
setObjectValue(java.lang.String key,
java.lang.Object value)
Sets the specified key equal to the passed object value. |
void |
setValue(java.lang.String key,
boolean value)
Sets the specified key equal to the passed value. |
void |
setValue(java.lang.String key,
double value)
Sets the specified key equal to the passed value. |
void |
setValue(java.lang.String key,
int value)
Sets the specified key equal to the passed value. |
void |
setValue(java.lang.String key,
java.lang.String newValue)
Sets the specified key equal to the passed value. |
int |
size()
Answers the number of elements |
java.lang.String |
toString()
Print out a string form of section including all of the keys and values included in the section. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String COPYRIGHT
protected static final java.lang.String STATUS
protected static final java.lang.String CHANGED_SINCE_STARTUP
protected static final java.lang.String NEWVALUE
protected static final java.lang.String REMOVED
protected static final java.lang.String STORED
Method Detail |
public java.lang.String getName()
public boolean exists(java.lang.String key)
key
- The key.true
if key exists in this section; else
false
if does not exist in this section.
This is a convenience method, since the Properties method could be used
as well.protected java.lang.String getInvisibleValue(java.lang.String thisKey)
thisKey
- name of the invisible attributeprotected void setInvisibleValue(java.lang.String thisKey, java.lang.String thisValue)
thisKey
- name of the invisible attributethisValue
- value to setprotected void removeInvisibleValue(java.lang.String thisKey)
thisKey
- name of the invisible attributepublic void clear()
public void load(java.io.InputStream inbuf) throws java.io.IOException
inbuf
- the input stream to load frompublic void save(java.io.OutputStream outbuf, java.lang.String sectionName)
outbuf
- the output streamsectionName
- the name of the sectionpublic java.lang.String getValue(java.lang.String key)
key
- The key.public java.lang.String getValue(java.lang.String key, java.lang.String defaultValue)
key
- The key.defaultValue
- Value to return if no value founddefaultValue
if key not available or the value
is returned.public int getIntegerValue(java.lang.String key)
key
- The key.public int getIntegerValue(java.lang.String key, int defaultValue)
key
- The key.defaultValue
- Value to return if no value founddefaultValue
if key not available or the value
is returned.public double getDoubleValue(java.lang.String key)
key
- The key.public double getDoubleValue(java.lang.String key, double defaultValue)
key
- The key.defaultValue
- Value to return if no value founddefaultValue
if key not available or the value
is returned.public boolean getBooleanValue(java.lang.String key)
key
- The key.false
if key not available or the value is
returned.public boolean getBooleanValue(java.lang.String key, boolean defaultValue)
key
- The keydefaultValue
- Value to return if no value founddefaultValue
if key not available or the value
is returned.public java.lang.Object getObjectValue(java.lang.String key)
key
- key.public java.lang.Object getObjectValue(java.lang.String key, java.lang.Object defaultValue)
key
- The keydefaultValue
- The value to return if no value founddefaultValue
if key not available or the value
is returned.public void setValue(java.lang.String key, java.lang.String newValue)
key
- The key.newValue
- The new value.public void setIntegerValue(java.lang.String key, int value)
key
- The key.value
- The new value.public void setValue(java.lang.String key, int value)
key
- The minor key.value
- The new value.public void setBooleanValue(java.lang.String key, boolean value)
key
- The key.value
- The new value.public void setValue(java.lang.String key, boolean value)
key
- The key.value
- The new value.public void setDoubleValue(java.lang.String key, double value)
key
- The key.value
- The new value.public void setValue(java.lang.String key, double value)
key
- The minor key.value
- The new value.public void setObjectValue(java.lang.String key, java.lang.Object value)
key
- The key.value
- The new value.public void removeValue(java.lang.String key)
key
- The key.public java.util.Enumeration propertyNames()
public boolean isCoalesced(java.lang.String key)
key
- preference namepublic java.util.Enumeration keys()
public int size()
public void list(java.io.PrintWriter writer)
writer
- the PrintWriter to write the attributes topublic java.lang.String getStatus()
for a method to print the names and values of the elements
of the section.
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |