Coverage details for umich.cac.data.BNodeField

LineHitsSource
1 package umich.cac.data;
2  
3 import umich.cac.pbs.FieldFactory;
4  
5 /**
6  *
7  * This class encapsulates B record Node fields. A node consists of a nodename,
8  * and optionally a cpu.
9  *
10  * PBS encodes these together in a single field, using different separators.
11  *
12  * <p>
13  *
14  * An example rendering output from this Field would be
15  *
16  * <pre>
17  *
18  *
19  * &ltnode&gt
20  *
21  * &ltnodename&gtnode047&lt/nodename&gt
22  *
23  * &ltcpu&gt0&lt/cpu&gt
24  *
25  * &lt/node&gt
26  *
27  * </pre>
28  *
29  * @author rmach@umich.edu
30  * @version $Header: /cvsroot/pbsaccounting/pbsaccounting/src/umich/cac/data/BNodeField.java,v 1.2 2003/10/21 19:08:00 rodmach Exp $
31  *
32  */
33  
34 public class BNodeField extends Field {
35  
36  
37     /** Nodes are seperated by + */
380    private String NODE_SEPARATOR = "\\+";
39  
40     /**
41      * Constructor for NodeField field, for a GENERIC field type
42      *
43      * @param fieldName
44      * Name of this field
45      * @param rawValue
46      * the raw value of this field from PBS accounting data
47      */
48  
49     public BNodeField(FieldName fieldName, String rawValue) {
50  
510        super(fieldName, rawValue, FieldType.GENERIC);
520        setupChildren(rawValue);
53  
540    }
55  
56     /**
57      * Contains children of type node. If just a hostname is encoded, only the
58      * NODENAME field is added. If a CPU and NAME are encoded both NODENAME and
59      * CPU fields are added.
60      *
61      * @param rawValue
62      * Description of the Parameter
63      */
64  
65     private void setupChildren(String rawValue) {
66  
670        String[] innerNodes = rawValue.split(NODE_SEPARATOR);
68  
690        for (int j = 0; j < innerNodes.length; j++) {
700            Field nodeField =
71                 FieldFactory.getInstance().getField(
72                     FieldName.NODE,
73                     innerNodes[j]);
740            addChild(nodeField);
75         }
760    }
77  
78 }

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.