Skip to main content
summaryrefslogtreecommitdiffstats
blob: 34604b15a0e38ee8362fdc44d8ddb783f950b151 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*******************************************************************************
 * 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;
 

/**
 * Internal class for the Prefix operand type. Not meant to be used by customers.
 * @since 1.1.0
 */
public class InternalInfixOperandType extends AbstractEnum {

	/**
	 * Used in Infix processing. Left operand on expression stack
	 */
	public final static int INFIX_LEFT_OPERAND_VALUE = 0;
	public final static InternalInfixOperandType INFIX_LEFT_OPERAND = new InternalInfixOperandType(INFIX_LEFT_OPERAND_VALUE, "Infix Left Operand Flag"); //$NON-NLS-1$
	/**
	 * Used in Infix processing. Other operand (but not last) on expression stack
	 */
	public final static int INFIX_OTHER_OPERAND_VALUE = 1;
	public final static InternalInfixOperandType INFIX_OTHER_OPERAND = new InternalInfixOperandType(INFIX_OTHER_OPERAND_VALUE,
	"Infix Other Operand Flag"); //$NON-NLS-1$
	/**
	 * Used in Infix processing. Rightmost (last) operand on expression stack
	 */
	public final static int INFIX_LAST_OPERAND_VALUE = 2;
	public final static InternalInfixOperandType INFIX_LAST_OPERAND = new InternalInfixOperandType(INFIX_LAST_OPERAND_VALUE, "Infix Last Operand Flag"); //$NON-NLS-1$

	/**
	 * Return the enum for the given value.
	 * @param value
	 * @return
	 * 
	 * @since 1.1.0
	 */
	public static InternalInfixOperandType get(int value) {
		switch (value) {
			case INFIX_LAST_OPERAND_VALUE:
				return INFIX_LAST_OPERAND;
			case INFIX_LEFT_OPERAND_VALUE:
				return INFIX_LEFT_OPERAND;
			case INFIX_OTHER_OPERAND_VALUE:
				return INFIX_OTHER_OPERAND;
		}
		return null;
	}
	
	private InternalInfixOperandType(int value, String name) {
		super(value, name);
	}
}

Back to the top