001: package org.drools.integrationtests.waltz;
002:
003: /*
004: * Copyright 2005 JBoss Inc
005: *
006: * Licensed under the Apache License, Version 2.0 (the "License");
007: * you may not use this file except in compliance with the License.
008: * You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */
018:
019: /**
020: * @author Alexander Bagerman
021: *
022: */
023:
024: import java.io.Serializable;
025:
026: /**
027: *
028: * @author Alexander Bagerman
029: *
030: */
031: public class Stage implements Serializable {
032: private static final long serialVersionUID = 400L;
033:
034: final public static int START = 0;
035:
036: final public static int DUPLICATE = 1;
037:
038: final public static int DETECT_JUNCTIONS = 2;
039:
040: final public static int FIND_INITIAL_BOUNDARY = 3;
041:
042: final public static int FIND_SECOND_BOUNDARY = 4;
043:
044: final public static int LABELING = 5;
045:
046: final public static int PLOT_REMAINING_EDGES = 9;
047:
048: final public static int DONE = 10;
049:
050: private int value;
051:
052: public Stage() {
053:
054: }
055:
056: public Stage(final int value) {
057: this .value = value;
058: }
059:
060: public int getValue() {
061: return this .value;
062: }
063:
064: public void setValue(final int value) {
065: this .value = value;
066: }
067:
068: public static int resolveStageValue(final String str) {
069: if (str.equals("start")) {
070: return 0;
071:
072: } else if (str.equals("duplicate")) {
073: return 1;
074:
075: } else if (str.equals("detect_junctions")) {
076: return 2;
077:
078: } else if (str.equals("find_initial_boundary")) {
079: return 3;
080:
081: } else if (str.equals("find_second_boundary")) {
082: return 4;
083:
084: } else if (str.equals("labeling")) {
085: return 5;
086:
087: } else if (str.equals("plot_remaining_edges")) {
088: return 9;
089:
090: } else if (str.equals("done")) {
091: return 10;
092: } else {
093: return -9999999;
094: }
095: }
096:
097: public String toString() {
098: return "{Stage value=" + this .value + "}";
099: }
100: }
|