|
 |
|
|
org.eclipse.rse.core.model
Class PropertySet
java.lang.Object
org.eclipse.rse.core.model.RSEPersistableObject
org.eclipse.rse.core.model.PropertySetContainer
org.eclipse.rse.core.model.RSEModelObject
org.eclipse.rse.core.model.PropertySet
-
All Implemented Interfaces:
-
Observer,
ILabeledObject,
IPropertySet,
IPropertySetContainer,
IRSEModelObject,
IRSEPersistableContainer
-
Direct Known Subclasses:
-
PropertyList
-
public class PropertySet
- extends
RSEModelObject
- implements
IPropertySet,
IRSEModelObject,
ILabeledObject,
Observer
A Hashmap based implementation of the
IPropertySet interface.
Not thread-safe since the underlying
HashMap
is
not thread-safe.
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
_defaultType
protected static
IPropertyType _defaultType
PropertySet
public PropertySet(
IPropertySet propertySet)
- Construct a new PropertySet based on an existing one (i.e. clone it).
-
Parameters:
-
propertySet - existing Property Set to clone
PropertySet
public PropertySet(
String name)
- Construct a new empty PropertySet.
-
Parameters:
-
name - of the new PropertySet
getName
public
String getName()
-
Description copied from interface:
IPropertySet
- Return the name of this Property Set.
-
-
Specified by:
-
getName
in interface
IPropertySet
-
Specified by:
-
getName
in interface
IRSEModelObject
-
-
Returns:
- String name of the Property Set.
getLabel
public
String getLabel()
-
-
Specified by:
-
getLabel
in interface
ILabeledObject
-
-
Returns:
- the display label for the object. If this has not
previously been set, this can return the name of object or
some other generated or constant label. It may return null
if no label can be determined.
setLabel
public void setLabel(
String label)
-
-
Specified by:
-
setLabel
in interface
ILabeledObject
-
-
Parameters:
-
label - A display label for this object.
getDescription
public
String getDescription()
-
Description copied from interface:
IPropertySet
- Return the description of this Property Set.
Note that in order to set the description, you need to call
addProperty(IPropertySet.DESCRIPTION_KEY, "Description");
-
-
Specified by:
-
getDescription
in interface
IPropertySet
-
Specified by:
-
getDescription
in interface
IRSEModelObject
-
Overrides:
-
getDescription
in class
RSEModelObject
-
-
Returns:
- Description of the Property Set,
or
null in case no description has been set.
setDescription
public void setDescription(
String description)
-
Description copied from interface:
IPropertySet
- Sets the description property of the property set.
Fully equivalent to
addProperty(IPropertySet.DESCRIPTION_KEY, description);
-
-
Specified by:
-
setDescription
in interface
IPropertySet
-
-
Parameters:
-
description - the string describing this property set.
getPropertyKeys
public
String[] getPropertyKeys()
-
Description copied from interface:
IPropertySet
- Return the list of Property Keys in this Set.
Provided that the Set has a description, the
-
-
Specified by:
-
getPropertyKeys
in interface
IPropertySet
-
-
Returns:
- String array of Property keys.
setName
public void setName(
String name)
-
Description copied from interface:
IPropertySet
- Set the name of this Property Set.
-
-
Specified by:
-
setName
in interface
IPropertySet
-
-
Parameters:
-
name - the name to set. Must not be null
setProperties
public void setProperties(
Map map)
-
Description copied from interface:
IPropertySet
- Set all the Properties of this set.
-
-
Specified by:
-
setProperties
in interface
IPropertySet
-
-
Parameters:
-
map - a Map of String to
IProperty associations.
addProperty
public
IProperty addProperty(
String key,
IProperty property)
- Add a typed Property to the set.
In case a Property already exists for the given key, it will be overwritten.
-
-
-
Parameters:
-
key - Key to add -
property - The Property to add
-
Returns:
- The added Property
addProperty
public
IProperty addProperty(
String key,
String value)
-
Description copied from interface:
IPropertySet
- Add a Property with String value to the set.
In case a Property already exist for the given key, it will be overwritten
by the new value, note that this will not change the Property's type,
so if the key identifies an integer Property but you set it to String value
"foo" the resulting Property Set will be inconsistent.
If the Property does not yet exist in the set, a new key will be added and
the new Property will be of type "String".
-
-
Specified by:
-
addProperty
in interface
IPropertySet
-
-
Parameters:
-
key - Key to add -
value - Value to add
-
Returns:
- The added Property
addProperty
public
IProperty addProperty(
String key,
String value,
IPropertyType type)
-
Description copied from interface:
IPropertySet
- Add a typed Property to the set.
In case a Property already exists for the given key, it will be
removed and replaced by the new one.
-
-
Specified by:
-
addProperty
in interface
IPropertySet
-
-
Parameters:
-
key - Key to add -
value - Value to add -
type - Type of the Property to add
-
Returns:
- The added Property
removeProperty
public boolean removeProperty(
String key)
-
Description copied from interface:
IPropertySet
- Remove a Property from the set.
-
-
Specified by:
-
removeProperty
in interface
IPropertySet
-
-
Parameters:
-
key - The key to remove
-
Returns:
-
true if the Property has been removed,
or false if the key has not been part of the set.
getProperty
public
IProperty getProperty(
String key)
-
Description copied from interface:
IPropertySet
- Return the
IProperty associated with the given key.
If the key is not in the set, null is returned.
-
-
Specified by:
-
getProperty
in interface
IPropertySet
-
-
Parameters:
-
key - String key for Property
-
Returns:
- requested Property,
or
null if the key is not found in the set.
getPropertyValue
public
String getPropertyValue(
String key)
-
Description copied from interface:
IPropertySet
- Return the String representation of a Property.
Provided that the key is found in the set, this is a shortcut
for getProperty(key).getValue(). If the key is not in the set,
null is returned.
-
-
Specified by:
-
getPropertyValue
in interface
IPropertySet
-
-
Parameters:
-
key - String key for Property
-
Returns:
- String value of requested Property,
or
null if the key is not found in the set.
getPropertyType
public
IPropertyType getPropertyType(
String key)
-
Description copied from interface:
IPropertySet
- Return the type of the property identified by the given key.
-
-
Specified by:
-
getPropertyType
in interface
IPropertySet
-
-
Parameters:
-
key - String key for Property
-
Returns:
- Type of requested Property,
or
null if the key is not found in the set.
commit
public boolean commit()
-
Description copied from interface:
IRSEPersistableContainer
- Request a persistence manager to persist this object.
-
-
Specified by:
-
commit
in interface
IRSEPersistableContainer
-
-
Returns:
- true if the object was persisted.
getPersistableChildren
public
IRSEPersistableContainer[] getPersistableChildren()
-
Description copied from interface:
IRSEPersistableContainer
- Retrieves the children of this object in the persistence containment hierarchy.
This is related to, but not necessarily the same as, the model hierarchy.
-
-
Specified by:
-
getPersistableChildren
in interface
IRSEPersistableContainer
-
-
Returns:
- the array of persistent children in the order they are to be stored in the
persistent form. This is an empty array if there are no children.
See
IRSEPersistableContainer.NO_CHILDREN .
getPersistableParent
public
IRSEPersistableContainer getPersistableParent()
-
Description copied from interface:
IRSEPersistableContainer
- Retrieve the parent of this object in the persistence containment hierarchy.
This is related to, but not necessarily the same as, the model hierarchy.
-
-
Specified by:
-
getPersistableParent
in interface
IRSEPersistableContainer
-
-
Returns:
- the parent persistent object. This is null if there is no parent.
setContainer
public void setContainer(
IPropertySetContainer container)
-
Description copied from interface:
IPropertySet
- Sets the container of this property set. Used to notify the container of
a change in a property.
-
-
Specified by:
-
setContainer
in interface
IPropertySet
-
-
Parameters:
-
container - the property set container
getContainer
public
IPropertySetContainer getContainer()
-
-
Specified by:
-
getContainer
in interface
IPropertySet
-
-
Returns:
- the container of this property set or null if there is no container.
update
public void update(
Observable o,
Object arg)
-
-
Specified by:
-
update
in interface
Observer
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|
|