tests/libjava-mauve/src/gnu/testlet/javax/print/attribute/HashAttributeSet/AnotherSimpleAttribute.java
branchjk_new_structure
changeset 1541 75c2e24dea9a
parent 1540 92ac284961c1
child 1542 be11db817bcf
equal deleted inserted replaced
1540:92ac284961c1 1541:75c2e24dea9a
     1 //Tags: not-a-test
       
     2 
       
     3 //Copyright (C) 2005 Free Software Foundation, Inc.
       
     4 //Written by Wolfgang Baer (WBaer@gmx.de)
       
     5 
       
     6 //This file is part of Mauve.
       
     7 
       
     8 //Mauve is free software; you can redistribute it and/or modify
       
     9 //it under the terms of the GNU General Public License as published by
       
    10 //the Free Software Foundation; either version 2, or (at your option)
       
    11 //any later version.
       
    12 
       
    13 //Mauve is distributed in the hope that it will be useful,
       
    14 //but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    15 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    16 //GNU General Public License for more details.
       
    17 
       
    18 //You should have received a copy of the GNU General Public License
       
    19 //along with Mauve; see the file COPYING.  If not, write to
       
    20 //the Free Software Foundation, 59 Temple Place - Suite 330,
       
    21 //Boston, MA 02111-1307, USA.  */
       
    22 
       
    23 package gnu.testlet.javax.print.attribute.HashAttributeSet;
       
    24 
       
    25 import javax.print.attribute.Attribute;
       
    26 
       
    27 /**
       
    28  * Another simple attribute implementation.
       
    29  */
       
    30 public class AnotherSimpleAttribute implements Attribute
       
    31 {
       
    32   private int value;
       
    33   
       
    34   public AnotherSimpleAttribute(int value) {
       
    35     this.value = value;
       
    36   }
       
    37   
       
    38   public Class getCategory()
       
    39   {
       
    40     return this.getClass();
       
    41   }
       
    42 
       
    43   public String getName()
       
    44   {
       
    45     return "AnotherSimpleAttribute";
       
    46   }
       
    47 
       
    48   public boolean equals(Object obj)
       
    49   {
       
    50     if (obj instanceof AnotherSimpleAttribute)
       
    51       {
       
    52         AnotherSimpleAttribute att = (AnotherSimpleAttribute) obj;
       
    53         if (att.value == this.value)
       
    54           return true;
       
    55       }
       
    56     return false;
       
    57   }
       
    58 
       
    59   public int hashCode()
       
    60   {
       
    61     return this.value;
       
    62   }
       
    63 
       
    64 }