View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.shared_orchestra.util.el;
20  
21  import java.util.Map;
22  import java.util.Set;
23  import java.util.Collection;
24  
25  /**
26   * @author Sylvain Vieujot (latest modification by $Author: skitching $)
27   * @version $Revision: 355303 $ $Date: 2005-12-09 02:36:08 +0100 (Fr, 09 Dez 2005) $
28   *
29   */
30  public abstract class GenericMap implements Map {
31  
32      /**
33       * This method should return the result of the test.
34       */
35      protected abstract Object getValue(Object key);
36  
37      public int size() {
38          return 1;
39      }
40  
41      public boolean isEmpty() {
42          return false;
43      }
44  
45      public boolean containsKey(Object key) {
46          return true;
47      }
48  
49      public boolean containsValue(Object value) {
50          return value instanceof Boolean;
51      }
52  
53      public Object get(Object key) {
54          return getValue(key);
55      }
56  
57      public Object put(Object key, Object value) {
58          return null;
59      }
60  
61      public Object remove(Object key) {
62          return null;
63      }
64  
65      public void putAll(Map m) {
66          // NoOp
67      }
68  
69      public void clear() {
70          // NoOp
71      }
72  
73      public Set keySet() {
74          return null;
75      }
76  
77      public Collection values() {
78          return null;
79      }
80  
81      public Set entrySet() {
82          return null;
83      }
84  }
85  
86