Coverage report

  %line %branch
org.cb.jset.JSetCard
92% 
100% 

 1  
 // START LICENSE
 2  
 // JSet - a Java JSet card board game implementation
 3  
 // Copyright (C) 2004 Jerome Lacoste
 4  
 //
 5  
 // This program is free software; you can redistribute it and/or modify
 6  
 // it under the terms of the GNU General Public License as published by
 7  
 // the Free Software Foundation; either version 2 of the License, or (at
 8  
 // your option) any later version.
 9  
 //
 10  
 // This program is distributed in the hope that it will be useful, but
 11  
 // WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 13  
 // General Public License for more details.
 14  
 //
 15  
 // You should have received a copy of the GNU General Public License
 16  
 // along with this program; if not, write to the Free Software
 17  
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 18  
 // END LICENSE
 19  
 
 20  
 package org.cb.jset;
 21  
 
 22  
 import org.cb.cardboard.Card;
 23  
 
 24  
 import java.io.Serializable;
 25  
 
 26  
 /**
 27  
  * An implementation of a Card for the game.
 28  
  *
 29  
  * Instances are immutable as they simply wraps a <code>CardProperties</code> instance. 
 30  
  * @author jerome@coffeebreaks.org - last modified by $Author: jerome $
 31  
  * @version $Id: JSetCard.java 129 2004-04-15 05:00:43Z jerome $
 32  
  */
 33  
 public class JSetCard implements Card, Serializable
 34  
 {
 35  
   private final CardProperties _properties;
 36  
 //  private boolean _selected = false;
 37  
 
 38  
   public JSetCard(final CardProperties properties)
 39  143
   {
 40  143
     _properties = properties;
 41  143
   }
 42  
 
 43  
   public CardProperties getProperties()
 44  
   {
 45  77156
     return _properties;
 46  
   }
 47  
 
 48  
 //  public void select(boolean select)
 49  
 //  {
 50  
 //    if (select != _selected)
 51  
 //    {
 52  
 //      _selected = select;
 53  
 //      int type = _selected ? CardEvent.SELECTED : CardEvent.DESELECTED;
 54  
 //      fireCardEvent(new CardEvent(type, this));
 55  
 //    }
 56  
 //  }
 57  
 //
 58  
   public boolean equals(final Object o)
 59  
   {
 60  353
     if (this == o) return true;
 61  353
     if (!(o instanceof JSetCard)) return false;
 62  
 
 63  353
     final JSetCard card = (JSetCard) o;
 64  
 
 65  353
     if (!_properties.equals(card._properties)) return false;
 66  
 
 67  51
     return true;
 68  
   }
 69  
 
 70  
   public int hashCode()
 71  
   {
 72  0
     return _properties.hashCode();
 73  
   }
 74  
 
 75  
   // /  private List _cardListeners = new ArrayList();
 76  
 //
 77  
 
 78  
 
 79  
 
 80  
 //  public boolean addCardListener(SetGameClientCardListener listener)
 81  
 //  {
 82  
 //    return _cardListeners.add(listener);
 83  
 //  }
 84  
 //
 85  
 //  public boolean removeCardListener(SetGameClientCardListener listener)
 86  
 //  {
 87  
 //    return _cardListeners.remove(listener);
 88  
 //  }
 89  
 //
 90  
 //  private void fireCardEvent(CardEvent event)
 91  
 //  {
 92  
 //    if (_cardListeners != null)
 93  
 //    {
 94  
 //      for (int i = 0; i < _cardListeners.size(); i++)
 95  
 //      {
 96  
 //        SetGameClientCardListener cardListenerIF = (SetGameClientCardListener) _cardListeners.get(i);
 97  
 //        cardListenerIF.notifyCardEvent(event);
 98  
 //      }
 99  
 //    }
 100  
 //  }
 101  
 
 102  
   public String toString()
 103  
   {
 104  1968
     final StringBuffer buf = new StringBuffer("JSetCard:");
 105  1968
     buf.append(_properties);
 106  1968
     return buf.toString();
 107  
   }
 108  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.