KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > internal > ui > refactoring > FinishResult


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ltk.internal.ui.refactoring;
12
13 /**
14  * Enumeration representing the finish result
15  *
16  * @since 3.0
17  */

18 public class FinishResult {
19     private int fValue;
20     
21     private FinishResult(int value) {
22         fValue= value;
23     }
24     
25     public static FinishResult createException() {
26         return new FinishResult(0);
27     }
28     
29     public boolean isException() {
30         return fValue == 0;
31     }
32     
33     public static FinishResult createInterrupted() {
34         return new FinishResult(1);
35     }
36     
37     public boolean isInterrupted() {
38         return fValue == 1;
39     }
40     
41     public static FinishResult createOK() {
42         return new FinishResult(2);
43     }
44     
45     public boolean isOK() {
46         return fValue == 2;
47     }
48 }
49
Popular Tags