|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gridlab.gat.Preferences
public class Preferences
An instance of this class represents user preferences for selecting adaptors. For an overview of the known preferences used by JavaGAT and known adaptors see: known preferences.
Constructor Summary | |
---|---|
Preferences()
Constructs a new Preferences with no mappings. |
|
Preferences(Preferences p)
Copy constructor. |
|
Preferences(Properties properties)
Constructs a new Preferences object out of a Properties
object. |
|
Preferences(String propertyFile)
Constructs a new Preferences object out of a Java
propertyFile . |
Method Summary | |
---|---|
Object |
clone()
Returns a shallow clone of this Preferences. |
boolean |
containsKey(String key)
Returns true if the supplied object equals() a key in this
Preferences. |
boolean |
containsValue(Object value)
Returns true if this Preferences contains a value o , such
that o.equals(value) . |
boolean |
equals(Object o)
|
Object |
get(String key)
Returns the value to which the specified key is mapped in the preferences. |
Object |
get(String key,
Object defaultValue)
Returns the value to which the specified key is mapped in the preferences. |
int |
hashCode()
|
Set<String> |
keySet()
Returns a "set view" of this Preferences' keys. |
Object |
put(String key,
Object value)
Associates the specified value with the specified key in this map (optional operation). |
void |
putAll(Preferences p)
Copies all of the mappings from the specified Preferences to this Preferences. |
void |
putAll(Properties properties)
Copies all of the mappings from the specified Properties to this
Preferences. |
Object |
remove(String key)
Removes from the preferences and returns the value which is mapped by the supplied key. |
String |
toString()
Converts this Preferences to a String, surrounded by braces, and with key/value pairs listed with an equals sign between, separated by a comma and space. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Preferences()
public Preferences(Preferences p)
NullPointerException
- if p
is null
, or contains
null
keys or valuespublic Preferences(String propertyFile)
Preferences
object out of a Java
propertyFile
. All the key value pairs in the
propertyFile
will be added to the new Preferences object.
propertyFile
- the property file containing the preferences.public Preferences(Properties properties)
Preferences
object out of a Properties
object. All the key value pairs in the Properties
object will be
added to the new Preferences object.
properties
- the Properties
object containing the preferences.Method Detail |
---|
public Object put(String key, Object value)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
UnsupportedOperationException
- if the put operation is not supported by this
map.
ClassCastException
- if the class of the specified key or value prevents it
from being stored in this map.
IllegalArgumentException
- if some aspect of this key or value prevents it from
being stored in this map.
NullPointerException
- this map does not permit null keys or values,
and the specified key or value is null.public Object get(String key)
key
- a key in the preferences
NullPointerException
- if the key or value is null.public Object get(String key, Object defaultValue)
key
- a key in the preferences
NullPointerException
- if the key or value is null.public void putAll(Preferences p)
p
- Preferences to be stored in this map.
NullPointerException
- if p
is null
, or contains
null
keys or valuespublic void putAll(Properties properties)
Properties
to this
Preferences. These mappings will replace any mappings that this
Preferences had for any of the keys currently in the specified
Preferences.
properties
- Properties
to be stored in this map.
NullPointerException
- if properties
is null
, or
contains null
keys or valuespublic Object clone()
clone
in class Object
public Object remove(String key)
null
is returned.
key
- the key used to locate the value to remove
public boolean containsKey(String key)
equals()
a key in this
Preferences.
key
- the key to search for in this Preferences
NullPointerException
- if key is nullpublic Set<String> keySet()
public boolean containsValue(Object value)
o
, such
that o.equals(value)
. This is the new API for the old
contains()
.
value
- the value to search for in this Preferences
NullPointerException
- if value
is nullpublic String toString()
"{a=1, b=2}"
.
NOTE: if the toString()
method of any key or value throws
an exception, this will fail for the same reason.
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |