001 /*
002 * $Id: MyMapImpl.java 1103095 2011-05-14 13:18:29Z simonetripodi $
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements. See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership. The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License. You may obtain a copy of the License at
010 *
011 * http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing,
014 * software distributed under the License is distributed on an
015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 * KIND, either express or implied. See the License for the
017 * specific language governing permissions and limitations
018 * under the License.
019 */
020 package org.apache.commons.ognl.test.objects;
021
022 import java.util.*;
023
024 /**
025 * This tests the interface inheritence test. This test implements MyMap->Map but extends Object, therefore should be
026 * coded using MapPropertyAccessor instead of ObjectPropertyAccessor.
027 */
028 public class MyMapImpl
029 extends Object
030 implements MyMap
031 {
032 private Map map = new HashMap();
033
034 public void clear()
035 {
036 map.clear();
037 }
038
039 public boolean containsKey( Object key )
040 {
041 return map.containsKey( key );
042 }
043
044 public boolean containsValue( Object value )
045 {
046 return map.containsValue( value );
047 }
048
049 public Set entrySet()
050 {
051 return map.entrySet();
052 }
053
054 public boolean equals( Object o )
055 {
056 return map.equals( o );
057 }
058
059 public Object get( Object key )
060 {
061 return map.get( key );
062 }
063
064 public int hashCode()
065 {
066 return map.hashCode();
067 }
068
069 public boolean isEmpty()
070 {
071 return map.isEmpty();
072 }
073
074 public Set keySet()
075 {
076 return map.keySet();
077 }
078
079 public Object put( Object key, Object value )
080 {
081 return map.put( key, value );
082 }
083
084 public void putAll( Map t )
085 {
086 map.putAll( t );
087 }
088
089 public Object remove( Object key )
090 {
091 return map.remove( key );
092 }
093
094 public int size()
095 {
096 return map.size();
097 }
098
099 public Collection values()
100 {
101 return map.values();
102 }
103
104 public String getDescription()
105 {
106 return "MyMap implementation";
107 }
108 }