EnumeratedType.java :  » Source-Control » sourcejammer » org » sourcejammer » util » Java Open Source

Java Open Source » Source Control » sourcejammer 
sourcejammer » org » sourcejammer » util » EnumeratedType.java
/*
 *  Copyright (C) 2001, 2002 Robert MacGrogan
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 *
 * $Archive: SourceJammer$
 * $FileName: EnumeratedType.java$
 * $FileID: 4322$
 *
 * Last change:
 * $AuthorName: Rob MacGrogan$
 * $Date: 4/23/03 5:23 PM$
 * $VerID: 8780$
 * $Comment: Replaced GPL header with LGPL header.$
 *
 */
package org.sourcejammer.util;

/**
 * @author $AuthorName: Rob MacGrogan$
 * @version $VerNum: 2$
 * $KeyWordsOff: $<br><br>
 */
public abstract class EnumeratedType {

  private String value = null;
  
  protected void setValue(String s){
    value = s;
  }  
  
  public boolean equals(Object o){
    boolean equal = false;
    Class myClass = this.getClass();
    Class compareClass = o.getClass();
    if (myClass.equals(compareClass)){
      EnumeratedType compareObj = (EnumeratedType)o;
      if (value.equals(compareObj.value)){
        equal = true;
      }
    }
    return equal;        
  }
  
  public String toString(){
    return value;
  }
  
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.