Changeset 3676


Ignore:
Timestamp:
2003-01-17T10:26:33+13:00 (21 years ago)
Author:
kjdon
Message:

new function to determine if a status code indicates completion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/util/GSStatus.java

    r3643 r3676  
    1515    // other
    1616    public static final int INFO = 20; // just an info message that doesnt mean anything
     17
     18    /** returns true if teh code indicates that a process is no longer running
     19     */
     20    public static boolean isCompleted(int code) {
     21    if (code == SUCCESS || code == ERROR || code == COMPLETED || code == HALTED) {
     22        return true;
     23    }
     24    return false;
     25    }
     26
     27    // there may be other types of error codes
     28    public static boolean isError(int code) {
     29    if (code == ERROR) {
     30        return true;
     31    }
     32    return false;
     33    }
     34
    1735}
     36
Note: See TracChangeset for help on using the changeset viewer.