001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.jetspeed.om.common.preference;
019:
020: import java.io.Serializable;
021: import java.util.Iterator;
022: import java.util.Locale;
023:
024: import org.apache.pluto.om.common.Description;
025: import org.apache.pluto.om.common.Preference;
026: import org.apache.pluto.om.common.PreferenceCtrl;
027:
028: /**
029: *
030: * PreferenceComposite
031: *
032: * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
033: * @version $Id: PreferenceComposite.java,v 1.2 2004/06/18 20:46:21 weaver Exp $
034: *
035: */
036: public interface PreferenceComposite extends PreferenceCtrl,
037: Preference, Serializable {
038: String DEFAULT_PREFERENCE = "org.apache.pluto.om.common.Preference.default";
039: String USER_PREFERENCE = "org.apache.pluto.om.common.Preference.default.user";
040:
041: void addDescription(Locale locale, String Description);
042:
043: Description getDescription(Locale locale);
044:
045: /**
046: * @throws java.lang.ArrayIndexOutofBounds if index is outside the constraints
047: * @param index
048: * @return The String value at the specified index or <code>null</code>
049: * if no values are present.
050: */
051: String getValueAt(int index);
052:
053: /**
054: *
055: * @param index
056: */
057: void removeValueAt(int index);
058:
059: /**
060: *
061: * <p>
062: * setValueAt
063: * </p>
064: * Sets the current Preference's value at <code>index</code>
065: * to the specified <code>value</code>
066: *
067: * @param index Index hows value will be set.
068: * @param value Value to set
069: *
070: */
071: void setValueAt(int index, String value);
072:
073: /**
074: *
075: * <p>
076: * addValue
077: * </p>
078: * Adds a new value to this Preference.
079: * @param value Vale to add to the preference
080: *
081: */
082: void addValue(String value);
083:
084: /**
085: *
086: * @return
087: */
088: String[] getValueArray();
089:
090: /**
091: *
092: * <p>
093: * setValues
094: * </p>
095: *
096: * Replaces the current set of values of this preference
097: * with this one.
098: *
099: * @param stringValues
100: *
101: */
102: void setValues(String[] stringValues);
103:
104: /**
105: * @return
106: */
107: String getType();
108:
109: /**
110: * @param string
111: */
112: void setType(String string);
113:
114: String[] cloneValues();
115:
116: Iterator getDescriptions();
117:
118: }
|