EMMA Coverage Report (generated Mon Mar 20 21:27:43 EST 2006)
[all classes][com.webhydra.slug.process]

COVERAGE SUMMARY FOR SOURCE FILE [Status.java]

nameclass, %method, %block, %line, %
Status.java100% (1/1)100% (5/5)100% (60/60)100% (12/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Status100% (1/1)100% (5/5)100% (60/60)100% (12/12)
<static initializer> 100% (1/1)100% (31/31)100% (6/6)
Status (String): void 100% (1/1)100% (6/6)100% (3/3)
isCompleted (Status): boolean 100% (1/1)100% (10/10)100% (1/1)
isInProcess (Status): boolean 100% (1/1)100% (10/10)100% (1/1)
toString (): String 100% (1/1)100% (3/3)100% (1/1)

1/*
2 * @(#) $Id: Status.java,v 1.1.1.1 2006/03/19 06:09:42 rossen Exp $
3 *
4 * Copyright (c) 2006, WebHydra.com
5 * All rights reserved.
6 * 
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 * 
10 *     * Redistributions of source code must retain the above copyright notice,
11 *       this list of conditions and the following disclaimer.
12 *     * Redistributions in binary form must reproduce the above copyright
13 *       notice, this list of conditions and the following disclaimer in the
14 *       documentation and/or other materials provided with the distribution.
15 *     * Neither the name of the WebHydra.com nor the names of its contributors
16 *       may be used to endorse or promote products derived from this software
17 *       without specific prior written permission.
18 * 
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31 
32package com.webhydra.slug.process;
33 
34import java.io.Serializable;
35 
36/**
37 * Process Status Enumeration
38 * @author rossen
39 */
40public final class Status implements Serializable
41{
42 
43    private static final long serialVersionUID = 1L;
44 
45    /**
46     * Constant for <CODE>running</CODE> process
47     */
48    public static final Status RUNNING   = new Status("running");
49    /**
50     * Constant for <CODE>completed</CODE> process
51     */
52    public static final Status COMPLETED = new Status("completed");
53    /**
54     * Constant for <CODE>stopped</CODE> proccess
55     */
56    public static final Status STOPPED   = new Status("stopped");
57    /**
58     * Constant for <CODE>failed</CODE> process
59     */
60    public static final Status FAILED    = new Status("failed");
61    /**
62     * Constant for <CODE>canceled</CODE> process
63     */
64    public static final Status CANCELED  = new Status("canceled");
65    /**
66     * Constant for <CODE>waiting</CODE> process
67     */
68    public static final Status WAITING   = new Status("waiting");
69 
70    private String status;
71 
72    /** Creates a new instance of Status
73     * @param status status value.
74     */
75    private Status(String status)
76    {
77        this.status = status;
78    }
79 
80    /** Overrides the default method implementation.
81     * @return status value.
82     */
83    public String toString() {
84        return status;
85    }
86 
87    /** Check if provided <code>Status</code> is completed.
88     * @return true if provided status is not one of <code>RUNNING</code> or
89     * <code>WAITING</code>, otherwise returns false.
90     */
91    public static boolean isCompleted(Status s)
92    {
93        return ((s != RUNNING) && (s != WAITING));
94    }
95 
96    /** Check if provided <code>Status</code> is in process.
97     * @return true if provided status is one of <code>RUNNING</code> or
98     * <code>WAITING</code>, otherwise returns false.
99     */
100    public static boolean isInProcess(Status s)
101    {
102        return ((s == RUNNING) || (s == WAITING));
103    }
104}

[all classes][com.webhydra.slug.process]
EMMA 2.0.5312 (C) Vladimir Roubtsov