KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > preferences > IPropertyMap


1 /*******************************************************************************
2  * Copyright (c) 2004, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.preferences;
12
13 import java.util.Set JavaDoc;
14
15 /**
16  * Eclipse provides many different classes and interfaces that map ids onto values and
17  * send property change notifications (some examples are themes, preference stores,
18  * xml nodes, property providers, and others). This interface is intended to provide
19  * interoperability between these various classes.
20  *
21  * @since 3.1
22  */

23 public interface IPropertyMap {
24     
25     /**
26      * Returns the set of keys that are recognized by this property map
27      * (optional operation).
28      *
29      * @return the set of valid keys for this map
30      * @throws UnsupportedOperationException if this type of property map
31      * cannot compute the set of valid keys
32      * @since 3.1
33      */

34     public Set JavaDoc keySet();
35     
36     /**
37      * Returns the value of the given property. Returns null if the given
38      * property does not exist, cannot be converted into the expected type,
39      * or if the value of the property is null.
40      *
41      * @param propertyId property ID to query
42      * @param propertyType type of the expected return value
43      * @return an object of the given propertyType or null if the property
44      * does not exist or has the wrong type
45      * @since 3.1
46      */

47     public Object JavaDoc getValue(String JavaDoc propertyId, Class JavaDoc propertyType);
48     
49     /**
50      * If this map represents the union of multiple property maps, this
51      * returns true iff the property existed in every map in the union.
52      * Always returns true if this map was not computed from the union
53      * of multiple maps.
54      *
55      * @param propertyId
56      * @return true iff the given property existed in every child map
57      * @since 3.1
58      */

59     public boolean isCommonProperty(String JavaDoc propertyId);
60     
61     /**
62      * Returns true iff the given property exists.
63      *
64      * @param propertyId
65      * @return true iff the given property exists in this map
66      * @since 3.1
67      */

68     public boolean propertyExists(String JavaDoc propertyId);
69       
70     /**
71      * Sets the value of the given property to the given value (optional
72      * operation).
73      *
74      * @param propertyId
75      * @param newValue
76      * @throws UnsupportedOperationException if this type of property map
77      * is read-only
78      * @since 3.1
79      */

80     public void setValue(String JavaDoc propertyId, Object JavaDoc newValue);
81 }
82
Popular Tags