001 /*
002 * Copyright 1999-2001,2004 The Apache Software Foundation.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017 package org.apache.commons.workflow.util;
018
019
020 import java.util.Map;
021
022
023 /**
024 * General purpose implementation of the <strong>Map.Entry</strong>
025 * interface for use in returning results from <code>entrySet()</code>
026 * methods on <code>Map</code> implementations.
027 *
028 * @version $Revision: 155475 $ $Date: 2005-02-26 13:31:11 +0000 (Sat, 26 Feb 2005) $
029 * @author Craig R. McClanahan
030 */
031
032 public class MapEntry implements Map.Entry {
033
034
035 // ----------------------------------------------------------- Constructors
036
037
038 /**
039 * Construct a new MapEntry based on the specified parameters.
040 *
041 * @param key Key for this entry
042 * @param value Value for this entry
043 */
044 public MapEntry(Object key, Object value) {
045
046 super();
047 setKey(key);
048 setValue(value);
049
050 }
051
052
053
054 // ------------------------------------------------------------- Properties
055
056
057 /**
058 * The key for this entry.
059 */
060 protected Object key = null;
061
062 public Object getKey() {
063 return (this.key);
064 }
065
066 public void setKey(Object key) {
067 this.key = key;
068 }
069
070
071 /**
072 * The value for for this entry.
073 */
074 protected Object value = null;
075
076 public Object getValue() {
077 return (this.value);
078 }
079
080 public Object setValue(Object value) {
081 Object old = this.value;
082 this.value = value;
083 return (old);
084 }
085
086
087 }