/protocols/jain-mgcp/stack/src/main/java/org/mobicents/protocols/mgcp/jain/pkg/Value.java

http://mobicents.googlecode.com/ · Java · 86 lines · 46 code · 19 blank · 21 comment · 0 complexity · 0e323cc87437dd760ef9e53b4abf77ce MD5 · raw file

  1. /*
  2. * JBoss, Home of Professional Open Source
  3. * Copyright 2011, Red Hat, Inc. and individual contributors
  4. * by the @authors tag. See the copyright.txt in the distribution for a
  5. * full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package org.mobicents.protocols.mgcp.jain.pkg;
  23. import java.util.Collection;
  24. import java.util.HashMap;
  25. import java.util.Map;
  26. import java.util.Set;
  27. public abstract class Value implements Map<Parameter, Value> {
  28. Map<Parameter, Value> parameterValueMap = new HashMap<Parameter, Value>();
  29. public Value() {
  30. }
  31. public void clear() {
  32. parameterValueMap.clear();
  33. }
  34. public Set<Entry<Parameter, Value>> entrySet() {
  35. return parameterValueMap.entrySet();
  36. }
  37. public boolean isEmpty() {
  38. return parameterValueMap.isEmpty();
  39. }
  40. public Set<Parameter> keySet() {
  41. return parameterValueMap.keySet();
  42. }
  43. public Value put(Parameter key, Value value) {
  44. return parameterValueMap.put(key, value);
  45. }
  46. public void putAll(Map<? extends Parameter, ? extends Value> t) {
  47. parameterValueMap.putAll(t);
  48. }
  49. public int size() {
  50. return parameterValueMap.size();
  51. }
  52. public Collection<Value> values() {
  53. return parameterValueMap.values();
  54. }
  55. public boolean containsKey(Object key) {
  56. return parameterValueMap.containsKey(key);
  57. }
  58. public boolean containsValue(Object value) {
  59. return parameterValueMap.containsKey(value);
  60. }
  61. public Value get(Object key) {
  62. return parameterValueMap.get(key);
  63. }
  64. public Value remove(Object key) {
  65. return parameterValueMap.remove(key);
  66. }
  67. }