Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.core.model
Class PropertySet

java.lang.Object
  extended by 

org.eclipse.rse.core.model.RSEPersistableObject
      extended by 

org.eclipse.rse.core.model.PropertySetContainer
          extended by 

org.eclipse.rse.core.model.RSEModelObject
              extended by 
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.


Field Summary
protected static  IPropertyType _defaultType
           
 
Fields inherited from interface org.eclipse.rse.core.model. IPropertySet
DESCRIPTION_KEY
 
Fields inherited from interface org.eclipse.rse.core.model. IRSEPersistableContainer
NO_CHILDREN
 
Constructor Summary
PropertySet ( IPropertySet propertySet)
          Construct a new PropertySet based on an existing one (i.e. clone it).
PropertySet ( String name)
          Construct a new empty PropertySet.
 
Method Summary
  IProperty addProperty ( String key, IProperty property)
          Add a typed Property to the set.
  IProperty addProperty ( String key, String value)
          Add a Property with String value to the set.
  IProperty addProperty ( String key, String value, IPropertyType type)
          Add a typed Property to the set.
 boolean commit ()
          Request a persistence manager to persist this object.
  IPropertySetContainer getContainer ()
           
  String getDescription ()
          Return the description of this Property Set.
  String getLabel ()
           
  String getName ()
          Return the name of this Property Set.
  IRSEPersistableContainer[] getPersistableChildren ()
          Retrieves the children of this object in the persistence containment hierarchy.
  IRSEPersistableContainer getPersistableParent ()
          Retrieve the parent of this object in the persistence containment hierarchy.
  IProperty getProperty ( String key)
          Return the IProperty associated with the given key.
  String[] getPropertyKeys ()
          Return the list of Property Keys in this Set.
  IPropertyType getPropertyType ( String key)
          Return the type of the property identified by the given key.
  String getPropertyValue ( String key)
          Return the String representation of a Property.
 boolean removeProperty ( String key)
          Remove a Property from the set.
 void setContainer ( IPropertySetContainer container)
          Sets the container of this property set.
 void setDescription ( String description)
          Sets the description property of the property set.
 void setLabel ( String label)
           
 void setName ( String name)
          Set the name of this Property Set.
 void setProperties ( Map map)
          Set all the Properties of this set.
 void update ( Observable o, Object arg)
           
 
Methods inherited from class org.eclipse.rse.core.model. PropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from class org.eclipse.rse.core.model. RSEPersistableObject
compareStrings, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.core.model. IPropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from interface org.eclipse.rse.core.model. IPropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from interface org.eclipse.rse.core.model. IRSEPersistableContainer
isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 

Field Detail

_defaultType

protected static 
IPropertyType _defaultType
Constructor Detail

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
Method Detail

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

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire