Coverage Report - org.dishevelled.graph.impl.AbstractMapEntryDecorator
 
Classes in this File Line Coverage Branch Coverage Complexity
AbstractMapEntryDecorator
0%
0/10
0%
0/2
1.333
 
 1  
 /*
 2  
 
 3  
     dsh-graph  Directed graph interface and implementation.
 4  
     Copyright (c) 2004-2013 held jointly by the individual authors.
 5  
 
 6  
     This library is free software; you can redistribute it and/or modify it
 7  
     under the terms of the GNU Lesser General Public License as published
 8  
     by the Free Software Foundation; either version 3 of the License, or (at
 9  
     your option) any later version.
 10  
 
 11  
     This library is distributed in the hope that it will be useful, but WITHOUT
 12  
     ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or
 13  
     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 14  
     License for more details.
 15  
 
 16  
     You should have received a copy of the GNU Lesser General Public License
 17  
     along with this library;  if not, write to the Free Software Foundation,
 18  
     Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
 19  
 
 20  
     > http://www.fsf.org/licensing/licenses/lgpl.html
 21  
     > http://www.opensource.org/licenses/lgpl-license.php
 22  
 
 23  
 */
 24  
 package org.dishevelled.graph.impl;
 25  
 
 26  
 import java.util.Map;
 27  
 
 28  
 /**
 29  
  * Abstract map entry decorator.
 30  
  *
 31  
  * @param <K> map entry key type
 32  
  * @param <V> map entry value type
 33  
  * @author  Michael Heuer
 34  
  * @version $Revision$ $Date$
 35  
  */
 36  
 abstract class AbstractMapEntryDecorator<K, V>
 37  
     implements Map.Entry<K, V>
 38  
 {
 39  
     /** Map entry this decorator decorates. */
 40  
     private Map.Entry<K, V> entry;
 41  
 
 42  
 
 43  
     /**
 44  
      * Create a new abstract map entyr that decorates the
 45  
      * specified map entry.
 46  
      *
 47  
      * @param entry map entry to decorate, must not be null
 48  
      */
 49  
     protected AbstractMapEntryDecorator(final Map.Entry<K, V> entry)
 50  0
     {
 51  0
         if (entry == null)
 52  
         {
 53  0
             throw new IllegalArgumentException("entry must not be null");
 54  
         }
 55  0
         this.entry = entry;
 56  0
     }
 57  
 
 58  
 
 59  
     /** {@inheritDoc} */
 60  
     public K getKey()
 61  
     {
 62  0
         return entry.getKey();
 63  
     }
 64  
 
 65  
     /** {@inheritDoc} */
 66  
     public V getValue()
 67  
     {
 68  0
         return entry.getValue();
 69  
     }
 70  
 
 71  
     /** {@inheritDoc} */
 72  
     public V setValue(final V value)
 73  
     {
 74  0
         return entry.setValue(value);
 75  
     }
 76  
 
 77  
     /** {@inheritDoc} */
 78  
     public int hashCode()
 79  
     {
 80  0
         return entry.hashCode();
 81  
     }
 82  
 
 83  
     /** {@inheritDoc} */
 84  
     public boolean equals(final Object o)
 85  
     {
 86  0
         return entry.equals(o);
 87  
     }
 88  
 }