Alachisoft.NCache.Parser.ParseResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nc-parser Show documentation
Show all versions of nc-parser Show documentation
Internal package of Alachisoft.
package Alachisoft.NCache.Parser;
/**
* Used internally to represent the result of the Parser.ParseToken method.
*/
public enum ParseResult {
/**
*
*/
Accept(301),
/**
*
*/
Shift(302),
/**
*
*/
ReduceNormal(303),
/**
*
*/
ReduceEliminated(304),
/**
*
*/
SyntaxError(305),
/**
*
*/
InternalError(406);
private static java.util.HashMap mappings;
private int intValue;
private ParseResult(int value) {
intValue = value;
ParseResult.getMappings().put(value, this);
}
private static java.util.HashMap getMappings() {
if (mappings == null) {
synchronized (ParseResult.class) {
if (mappings == null) {
mappings = new java.util.HashMap();
}
}
}
return mappings;
}
public static ParseResult forValue(int value) {
return getMappings().get(value);
}
public int getValue() {
return intValue;
}
}