|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibis.ipl.StaticProperties
Container for the properties of an Ibis
or a
PortType
.
A property consists of a name (key), and its value, a set of strings.
for instance: name: serialization, value: {sun}.
The properties are static, that is, once a property is set, its value
cannot be changed.
The value of a property is usually given as a string, which is then
split into words (a word separator is one of
" ,\t\n\r\f"). These words can be queried as well, by means of the
isProp(String, String)
method. For instance,
isProp("communication", "OneToMany")
could be a query to
find out if multicast is supported (or required, when a porttype is
created).
Constructor Summary | |
StaticProperties()
Creates an empty property set. |
|
StaticProperties(StaticProperties sp)
Creates an empty property set with the specified defaults. |
Method Summary | |
void |
add(java.lang.String key,
java.lang.String value)
Adds a key/value pair to the properties. |
java.lang.Object |
clone()
Creates and returns a clone of this. |
StaticProperties |
combine(StaticProperties p)
Combines the properties with the specified properties, giving preference to the latter. |
StaticProperties |
combineWithUserProps()
Combines the specified properties with system properties as specified by the user, giving preference to the latter. |
StaticProperties |
copy()
Returns a copy of the properties. |
boolean |
equals(java.lang.Object other)
Returns true if other represents the same property
set. |
java.lang.String |
find(java.lang.String key)
Returns the value associated with the specified key, or null . |
java.util.Set |
findSet(java.lang.String key)
Returns the value associated with the specified key, as a set. |
java.lang.String |
getProperty(java.lang.String key)
Returns the value associated with the specified key, or null . |
int |
hashCode()
Returns the hashcode of this property set. |
boolean |
isProp(java.lang.String cat,
java.lang.String prop)
Returns true if the specified property category has the specified property set. |
void |
load(java.io.InputStream in)
Reads the properties from the specified InputStream . |
boolean |
matchProperties(StaticProperties sp)
Matches the current properties with the static properties supplied. |
StaticProperties |
merge(StaticProperties p)
Merges the properties with the specified properties. |
java.util.Set |
propertyNames()
Returns the set of property names. |
int |
size()
Returns the number of property names in this property set. |
java.lang.String |
toString()
Returns all key/value pairs as a string. |
StaticProperties |
unmatchedProperties(StaticProperties sp)
Matches the current properties with the static properties supplied. |
static StaticProperties |
userProperties()
Returns the static properties as derived from the system properties provided by the user running the application. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public StaticProperties()
public StaticProperties(StaticProperties sp)
Method Detail |
public java.util.Set propertyNames()
public int size()
public static StaticProperties userProperties()
public StaticProperties combineWithUserProps()
public StaticProperties combine(StaticProperties p)
p
- the properties to combine with.
public StaticProperties merge(StaticProperties p)
combine(StaticProperties)
does.
p
- the properties to merge with.
public boolean matchProperties(StaticProperties sp)
sp
- the static properties to be matched with.
public StaticProperties unmatchedProperties(StaticProperties sp)
sp
- the static properties to be matched with.
public void add(java.lang.String key, java.lang.String value)
IbisRuntimeException
is thrown. If either the key or the value is null
,
a NullPointer
is thrown.
key
- the key to be bound.value
- the value to bind to the key.
IbisRuntimeException
- is thrown when the key is already bound.
java.lang.NullPointerException
- is thrown when either key or value
is null
.public java.lang.String getProperty(java.lang.String key)
null
.
This is a synonym for find(String)
public java.lang.String find(java.lang.String key)
null
.
public java.util.Set findSet(java.lang.String key)
public boolean isProp(java.lang.String cat, java.lang.String prop)
cat
- the property category.prop
- the property.
public java.lang.Object clone()
public java.lang.String toString()
public void load(java.io.InputStream in) throws java.io.IOException
InputStream
.
in
- the InputStream
.
java.io.IOException
- is thrown when an IO error occurs.public StaticProperties copy()
public boolean equals(java.lang.Object other)
other
represents the same property
set.
other
- the object to compare with.
public int hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |