blob: 451e751a8c94a1f65b1775ad4e9e81bdf21beec5 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
/*
*/
package org.eclipse.jem.internal.proxy.initParser.tree;
/**
* Base abstract implementation of the enum.
* @since 1.1.0
*/
public abstract class AbstractEnum implements Enum {
/**
* The name of the enumerator.
*/
private final String name;
/**
* The <code>int</code> value of the enumerator.
*/
private final int value;
/**
* Creates an initialized instance.
*
* @param value
* the <code>int</code> value of the enumerator.
* @param name
* the name of the enumerator.
*/
protected AbstractEnum(int value, String name) {
this.name = name;
this.value = value;
}
/**
* Returns the name of the enumerator.
*
* @return the name.
*/
public final String getName() {
return name;
}
/**
* Returns the <code>int</code> value of the enumerator.
*
* @return the value.
*/
public final int getValue() {
return value;
}
/**
* Returns the name of the enumerator.
*
* @return the name.
*/
public final String toString() {
return name;
}
}