001: //--------------------------------------------------------------------------
002: // Copyright (c) 2004, Drew Davidson and Luke Blanshard
003: // All rights reserved.
004: //
005: // Redistribution and use in source and binary forms, with or without
006: // modification, are permitted provided that the following conditions are
007: // met:
008: //
009: // Redistributions of source code must retain the above copyright notice,
010: // this list of conditions and the following disclaimer.
011: // Redistributions in binary form must reproduce the above copyright
012: // notice, this list of conditions and the following disclaimer in the
013: // documentation and/or other materials provided with the distribution.
014: // Neither the name of the Drew Davidson nor the names of its contributors
015: // may be used to endorse or promote products derived from this software
016: // without specific prior written permission.
017: //
018: // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
019: // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
020: // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
021: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
022: // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
023: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
024: // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
025: // OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
026: // AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
027: // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
028: // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
029: // DAMAGE.
030: //--------------------------------------------------------------------------
031: package org.ognl.test.objects;
032:
033: import java.util.*;
034:
035: /**
036: This tests the interface inheritence test. This test implements
037: MyMap->Map but extends Object, therefore should be coded using
038: MapPropertyAccessor instead of ObjectPropertyAccessor.
039: */
040: public class MyMapImpl extends Object implements MyMap {
041: private Map map = new HashMap();
042:
043: public void clear() {
044: map.clear();
045: }
046:
047: public boolean containsKey(Object key) {
048: return map.containsKey(key);
049: }
050:
051: public boolean containsValue(Object value) {
052: return map.containsValue(value);
053: }
054:
055: public Set entrySet() {
056: return map.entrySet();
057: }
058:
059: public boolean equals(Object o) {
060: return map.equals(o);
061: }
062:
063: public Object get(Object key) {
064: return map.get(key);
065: }
066:
067: public int hashCode() {
068: return map.hashCode();
069: }
070:
071: public boolean isEmpty() {
072: return map.isEmpty();
073: }
074:
075: public Set keySet() {
076: return map.keySet();
077: }
078:
079: public Object put(Object key, Object value) {
080: return map.put(key, value);
081: }
082:
083: public void putAll(Map t) {
084: map.putAll(t);
085: }
086:
087: public Object remove(Object key) {
088: return map.remove(key);
089: }
090:
091: public int size() {
092: return map.size();
093: }
094:
095: public Collection values() {
096: return map.values();
097: }
098:
099: public String getDescription() {
100: return "MyMap implementation";
101: }
102: }
|