umich.cac.pbs
Class FieldFactory

java.lang.Object
  extended byumich.cac.pbs.FieldFactory

public class FieldFactory
extends java.lang.Object

Singleton takes a String from the PBS file, and returns the proper Field object based on the name of the field, and the field value.

Example:

  //This would be coming from PBS String nameField = "date"; String valueField = "10/12/02 10:11:11"; //Grab the dateNode Field dateNode = FieldFactory.getInstance().getField(nameField, valueField);
 

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

Method Summary
 Field getField(FieldName fieldName, java.lang.String fieldValue)
          Helper method to return the Field object when the FieldName and FieldValue are known
 Field getField(java.lang.String pbsField, java.lang.String fieldValue)
          Return the appropriate Field object based on the fieldName and fieldValue, or null if no match is found
static FieldFactory getInstance()
          Get singleton instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static FieldFactory getInstance()
Get singleton instance

Returns:
The instance value

getField

public Field getField(java.lang.String pbsField,
                      java.lang.String fieldValue)
Return the appropriate Field object based on the fieldName and fieldValue, or null if no match is found

Parameters:
pbsField - The name of the field, like "etime"
fieldValue - The corresponding value, like "12330404"
Returns:
The Field object for this fieldName, fieldValue combination, or null if there is no matching field found.

getField

public Field getField(FieldName fieldName,
                      java.lang.String fieldValue)
Helper method to return the Field object when the FieldName and FieldValue are known

Parameters:
fieldName - Name of the field
fieldValue - Value of the field
Returns:
The field value, or null if no matching field found