Coverage details for umich.cac.pbs.RecordType

LineHitsSource
1 package umich.cac.pbs;
2  
3 /**
4  * Typesafe enumeration class for all record types. These record types are the
5  * 2nd Field in the PBS comma separated record. For example the following line
6  * would have a record type of QUEUE_RECORD (Q)
7  *
8  * <pre>
9  * 12/17/2002 00:11:11;Q;15045.head;queue=cac
10  * </pre>
11  *
12  * <P>
13  *
14  * Types available:
15  * <UL>
16  * <LI>EXECUTION_RECORD</LI>
17  * <LI>START_RECORD</LI>
18  * <LI>QUEUE_RECORD</LI>
19  * <LI>DELETE_RECORD</LI>
20  * <LI>RERUN_RECORD</LI>
21  * <LI>ABORT_RECORD</LI>
22  * <LI>CHECKPOINT_RESTART_RECORD</LI>
23  * </UL>
24  *
25  * And these PBSPro specific ones
26  *
27  * <UL>
28  * <LI>U_RECORD</LI>
29  * <LI>Y_RECORD</LI>
30  * <LI>K_RECORD</LI>
31  * <LI>L_RECORD</LI>
32  * </UL>
33  *
34  * @author rmach@umich.edu
35  * @version $Header: /cvsroot/pbsaccounting/pbsaccounting/src/umich/cac/pbs/RecordType.java,v 1.4 2003/10/21 19:07:59 rodmach Exp $
36  */
37  
38 public class RecordType {
39  
40     //Description of the record
41  
42     private String desc;
43  
44     /**
45      * PBS Execution record
46      */
47  
483    public final static RecordType EXECUTION_RECORD = new RecordType("E");
49  
50     /**
51      * PBS Queue record
52      */
53  
543    public final static RecordType QUEUE_RECORD = new RecordType("Q");
55  
56     /**
57      * PBS Start record
58      */
59  
603    public final static RecordType START_RECORD = new RecordType("S");
61  
62     /**
63      * PBS Delete record
64      */
65  
663    public final static RecordType DELETE_RECORD = new RecordType("D");
67  
68     /**
69      * PBS Rerun record
70      */
71  
723    public final static RecordType RERUN_RECORD = new RecordType("R");
73  
74     /**
75      * PBS Abort record
76      */
77  
783    public final static RecordType ABORT_RECORD = new RecordType("A");
79  
80     /**
81      * PBS Checkpoint Restart record
82      */
833    public final static RecordType CHECKPOINT_RESTART_RECORD =
84         new RecordType("T");
85  
86     /**
87      * PBSPro K Record
88      */
893    public final static RecordType K_RECORD = new RecordType("K");
90  
91     /**
92      * PBSPro L Record
93      */
943    public final static RecordType L_RECORD = new RecordType("L");
95  
96     /**
97      * PBSPro U Record
98      */
993    public final static RecordType U_RECORD = new RecordType("U");
100  
101     /**
102      * PBSPro Y Record
103      */
1043    public final static RecordType Y_RECORD = new RecordType("Y");
105  
106     /**
107      * PBSPro B Record
108      */
1093    public final static RecordType B_RECORD = new RecordType("B");
110  
111     /**
112      * Constructor for the RecordType object
113      *
114      * @param desc
115      * The record type string from the RecordPosition.RECORD_TYPE
116      * position
117      */
118  
11951    public RecordType(String desc) {
120  
12151        this.desc = desc;
122  
12351    }
124  
125     /**
126      * String representation for debugging
127      *
128      * @return String representation
129      */
130  
131     public String toString() {
132  
1339        return desc;
134     }
135  
136     /**
137      * Record types are equal if their description is the same
138      *
139      * @param recordType
140      * RecordType object to compare
141      * @return true if equal, false otherwise
142      */
143  
144     public boolean equals(RecordType recordType) {
145  
146117        if (recordType == null) {
147  
1480            return false;
149         }
150  
151         //Record types are equal based on desc field. I have to ignore
152         //case because of a bug in PbsPro where K records are both upper
153         //and lower case.
154  
155117        if (recordType.getDesc().equalsIgnoreCase(desc)) {
156  
15718            return true;
158         } else {
159  
16099            return false;
161         }
162  
163     }
164  
165     /**
166      * Returns the representation of the description field (.e.g "E", "Q", "S")
167      * used for overriding equals
168      *
169      * @return The description
170      */
171  
172     public String getDesc() {
173  
174117        return this.desc;
175     }
176  
177 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.