|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.data.DataColumnProperties
public final class DataColumnProperties
Property map that contains annotations assigned to a column. This class
implements a slim, read only version of java's Properties
class,
whereby all related methods delegate to the underlying property object. This
class is used by the DataColumnSpec
.
Properties
,
DataColumnSpec.getProperties()
Constructor Summary | |
---|---|
DataColumnProperties()
Creates an empty DataColumnProperties object. |
|
DataColumnProperties(Map<String,String> content)
Creates a properties object containing the (key, value) pairs from the argument. |
Method Summary | |
---|---|
DataColumnProperties |
cloneAndOverwrite(Map<String,String> newProperties)
Creates a new instance which carries all properties from this object and adds the newProperties . |
boolean |
containsProperty(String key)
Tests if this properties object contains a given key. |
boolean |
equals(Object obj)
Compares a given object on equality. |
String |
getProperty(String key)
Get the property value for the given key or
null if key does not exist. |
String |
getProperty(String key,
String defaultValue)
Get the property assigned to key or - if this property
does not exist - the defaultValue . |
int |
hashCode()
Hash code based on underlying Properties class. |
static DataColumnProperties |
load(ConfigRO config)
Reads all properties (key-value pairs) from the given ConfigRO
and returns a new DataColumnProperties object. |
Enumeration<String> |
properties()
Get an enumeration on all keys in this property object. |
void |
save(ConfigWO config)
Saves all key-value pairs to the given ConfigWO . |
int |
size()
Get the number of properties in this object. |
String |
toString()
Returns a string containing key=value pairs, separated by ", ". |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DataColumnProperties()
public DataColumnProperties(Map<String,String> content)
null
(but may be
empty). Any subsequent change to the argument is not reflected in this
object.
content
- a map with key-value pairs
NullPointerException
- if the argument is null
Method Detail |
---|
public boolean containsProperty(String key)
key
- the key to check
true
if key
is contained in this
property object, false
otherwise
NullPointerException
- if the key is null
Hashtable.containsKey(Object)
public String getProperty(String key, String defaultValue)
key
or - if this property
does not exist - the defaultValue
.
key
- request-keydefaultValue
- the value to be returned if key
is not
contained in this property object
key
or the
defaultValue
NullPointerException
- if key
is null
Properties.getProperty(String, String)
public String getProperty(String key)
key
or
null
if key
does not exist.
key
- request key
null
if key
is not contained
NullPointerException
- if argument is null
Properties.getProperty(String)
public int size()
Hashtable.size()
public Enumeration<String> properties()
Properties.propertyNames()
public DataColumnProperties cloneAndOverwrite(Map<String,String> newProperties)
newProperties
. If there is a key conflict the
newProperties overwrite the old ones. This serves as a convenient way to
add new properties to a DataColumnProperties
object.
newProperties
- the new properties to add
NullPointerException
- if the argument is null
public String toString()
toString
in class Object
Hashtable.toString()
public boolean equals(Object obj)
DataColumnProperties
object and contains the equal key
value pairs.
equals
in class Object
obj
- to compare to
true
if the given object is equal to this property
objectpublic int hashCode()
Properties
class.
hashCode
in class Object
Hashtable.hashCode()
public void save(ConfigWO config)
ConfigWO
.
Note: This implementation adds the pairs directly to the argument, make sure to provide an empty subconfig!
config
- write properties into this objectpublic static DataColumnProperties load(ConfigRO config) throws InvalidSettingsException
ConfigRO
and returns a new DataColumnProperties
object.
config
- to read properties from
InvalidSettingsException
- if the keys entry is not
available or a value is not available for a given key
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |