umich.cac.data
Class Field

java.lang.Object
  extended byumich.cac.data.Field
Direct Known Subclasses:
BNodeField, DateField, ExecHostField, MemField, NodeField, NodesField

public class Field
extends java.lang.Object

This class encapsulates a a "Field" of a PBS accounting record. A field contains a name, value, and child fields

Version:
$Header: /cvsroot/pbsaccounting/pbsaccounting/doc/javadoc/umich/cac/data/Field.html,v 1.6 2003/10/21 20:33:47 rodmach Exp $
Author:
rmach@umich.edu

Field Summary
protected  java.util.Vector childrenFields
          A container for child fields
protected  FieldName fieldName
          Encapsulates the raw name and display name of the field
protected  FieldType fieldType
          The type of field this is
protected  java.lang.String nl
          The new line seperator for this system
protected  java.lang.String rawValue
          The raw value of this field from accounting file
 
Constructor Summary
Field(FieldName fieldName, java.lang.String rawValue, FieldType fieldType)
          Constructor
 
Method Summary
 void addAttribute(Attribute attribute)
          Add an attribute object to this list, in order they should appear
 void addChild(Field childField)
          Add children Fields to this field.
 java.util.List getAttributes()
          Return the attributes, in order they were added
 java.util.Vector getChildren()
          Gets the children Fields of this field
 FieldName getFieldName()
          Return the FieldName, for unit testing
 FieldType getFieldType()
          Return the type of field this is
 java.lang.String getRawValue()
          Returns the "raw" value from PBS encoding.
protected  void setRawValue(java.lang.String rawValue)
          Returns the "raw" value from PBS encoding.
 java.lang.String toXML()
          Renders the XML representation of this field, and all of it's children
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldName

protected FieldName fieldName
Encapsulates the raw name and display name of the field


fieldType

protected FieldType fieldType
The type of field this is


childrenFields

protected java.util.Vector childrenFields
A container for child fields


rawValue

protected java.lang.String rawValue
The raw value of this field from accounting file


nl

protected java.lang.String nl
The new line seperator for this system

Constructor Detail

Field

public Field(FieldName fieldName,
             java.lang.String rawValue,
             FieldType fieldType)
Constructor

Parameters:
fieldName - FieldName describing this field
rawValue - The value of this field from accounting data
fieldType - The type of field
Method Detail

getFieldName

public FieldName getFieldName()
Return the FieldName, for unit testing

Returns:
FieldName The FieldName object for this Field

getFieldType

public FieldType getFieldType()
Return the type of field this is

Returns:
The fieldType value

getRawValue

public java.lang.String getRawValue()
Returns the "raw" value from PBS encoding. Used for unit tests

Returns:
The rawValue value

setRawValue

protected void setRawValue(java.lang.String rawValue)
Returns the "raw" value from PBS encoding. Used for unit tests protected so some special fields (like neednodes) that need to munge themselves can do so

Returns:
The rawValue value

addChild

public void addChild(Field childField)
Add children Fields to this field.

Parameters:
childField - a child to this field

getChildren

public java.util.Vector getChildren()
Gets the children Fields of this field

Returns:
A vector of children Fields

addAttribute

public void addAttribute(Attribute attribute)
Add an attribute object to this list, in order they should appear

Parameters:
attribute - The attribute to add

getAttributes

public java.util.List getAttributes()
Return the attributes, in order they were added

Returns:
List of Attribute objects

toXML

public java.lang.String toXML()
Renders the XML representation of this field, and all of it's children

Returns:
The XML representation of the field