001// Copyright 2011 The Apache Software Foundation
002//
003// Licensed under the Apache License, Version 2.0 (the "License");
004// you may not use this file except in compliance with the License.
005// You may obtain a copy of the License at
006//
007// http://www.apache.org/licenses/LICENSE-2.0
008//
009// Unless required by applicable law or agreed to in writing, software
010// distributed under the License is distributed on an "AS IS" BASIS,
011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012// See the License for the specific language governing permissions and
013// limitations under the License.
014
015package org.apache.tapestry5.plastic;
016
017/**
018 * Condition used with {@link InstructionBuilder#when(Condition, WhenCallback)}. Most conditions
019 * pop the top element off the stack; some pop two elements.
020 */
021public enum Condition
022{
023    /** Is the top element of the stack null? */
024    NULL,
025
026    /** Is the top element of the stack non-null? */
027    NON_NULL,
028
029    /** Is the top element of the stack the integer zero? */
030    ZERO,
031
032    /** Is the top element of the stack not the integer zero? */
033    NON_ZERO,
034
035    /**
036     * Compare two integer elements on the stack; branch if the deeper
037     * element is less than the top element.
038     */
039    LESS_THAN,
040
041    /**
042     * Compare two integer elements on the stack; branch if the deeper
043     * element equal to the top element.
044     */
045    EQUAL,
046
047    /**
048     * Compare two integer elements on the stack; branch if the deeper
049     * element is not equal to the top element.
050     */
051    NOT_EQUAL,
052
053    /**
054     * Compare two integer elements on the stack; branch if the deeper
055     * element is greater than the top element.
056     */
057    GREATER;
058}