net.sourceforge.nite.meta.impl
Class NiteObservation

java.lang.Object
  extended by net.sourceforge.nite.meta.impl.NiteObservation
All Implemented Interfaces:
NObservation

public class NiteObservation
extends java.lang.Object
implements NObservation

An observation as referred to in the metadata

Author:
jonathan

Constructor Summary
NiteObservation(NiteMetaData meta, java.lang.String name, java.lang.String description)
          This constructor is for users adding observations programatically with no observation variables or user codings.
NiteObservation(NiteMetaData meta, java.lang.String name, java.lang.String description, org.w3c.dom.Document doc, org.w3c.dom.Node node)
          Create an observation with no observation variables or user codings.
NiteObservation(NiteMetaData meta, java.lang.String name, java.lang.String description, java.util.List vars, java.util.List user_codings)
          Create an observation with observation variables and user codings.
NiteObservation(NiteMetaData meta, java.lang.String name, java.lang.String description, java.util.List vars, java.util.List user_codings, org.w3c.dom.Document doc, org.w3c.dom.Node node)
          Create an observation with observation variables and user codings.
 
Method Summary
 void addUserCoding(NUserCoding coding)
          Add a user coding to the corpus.
 NUserCoding findCoding(java.lang.String codingname, java.lang.String agentname)
          find a user coding for this observation that has coding and agent matching.
 java.lang.String getDescription()
          returns a description of the observation.
 org.w3c.dom.Node getNode()
          Get the DOM node which represents this observation in the tree.
 java.lang.String getShortName()
          The identifier for this observation as used in filenames etc.
 java.util.List getUserCodings()
          returns a list of user codings (see NiteUserCoding).
 java.lang.String getVariable(java.lang.String variable)
          return the value of the observation variable for the given variable name
 java.util.List getVariables()
          returns a list of strings: these are the values of the observation variables in the same order as you get the declarations from the getObservationVariables call from the metadata.
 void setDocument(org.w3c.dom.Document document)
          set the DOM document of which this observation is a part Only used by methods that edit the DOM.
 void setNode(org.w3c.dom.Node node)
          set the DOM node which represents this observation in the tree.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NiteObservation

public NiteObservation(NiteMetaData meta,
                       java.lang.String name,
                       java.lang.String description)
This constructor is for users adding observations programatically with no observation variables or user codings. Once the Observatoion has been created, don't forget to add it to the metadata file using NiteMetaData.addObservation.


NiteObservation

public NiteObservation(NiteMetaData meta,
                       java.lang.String name,
                       java.lang.String description,
                       java.util.List vars,
                       java.util.List user_codings)
Create an observation with observation variables and user codings. This constructor is used for adding observations programatically. Once the Observatoion has been created, don't forget to add it to the metadata file using NiteMetaData.addObservation. Variables are assumed to be a List of Strings in the same order as the variables are returned from the getObservationVariables call of NiteMetaData. Warnings will be emitted if they don't conform in number and type (though only if validation is switched on). User codings are passed as a List of ready-made NiteUserCodings.


NiteObservation

public NiteObservation(NiteMetaData meta,
                       java.lang.String name,
                       java.lang.String description,
                       org.w3c.dom.Document doc,
                       org.w3c.dom.Node node)
Create an observation with no observation variables or user codings. This constructor is used internally for building up the metadata structure from an existing file. The node that represents this observation in the in-memory XML version of the metadata file is passed as an argument.


NiteObservation

public NiteObservation(NiteMetaData meta,
                       java.lang.String name,
                       java.lang.String description,
                       java.util.List vars,
                       java.util.List user_codings,
                       org.w3c.dom.Document doc,
                       org.w3c.dom.Node node)
Create an observation with observation variables and user codings. This constructor is used internally for building up the metadata structure from an existing file. Variables are assumed to be a List of Strings in the same order as the variables are returned from the getObservationVariables call of NiteMetaData! Warnings will be emitted if they don't conform in number and type (though only if validation is switched on). User codings are passed as a List of ready-made NiteUserCodings.

Method Detail

getShortName

public java.lang.String getShortName()
The identifier for this observation as used in filenames etc. Could be something like "q4nc8" for the Map Task.

Specified by:
getShortName in interface NObservation

getDescription

public java.lang.String getDescription()
returns a description of the observation.

Specified by:
getDescription in interface NObservation

getVariables

public java.util.List getVariables()
returns a list of strings: these are the values of the observation variables in the same order as you get the declarations from the getObservationVariables call from the metadata.

Specified by:
getVariables in interface NObservation

getVariable

public java.lang.String getVariable(java.lang.String variable)
return the value of the observation variable for the given variable name

Specified by:
getVariable in interface NObservation

getUserCodings

public java.util.List getUserCodings()
returns a list of user codings (see NiteUserCoding).

Specified by:
getUserCodings in interface NObservation

findCoding

public NUserCoding findCoding(java.lang.String codingname,
                              java.lang.String agentname)
find a user coding for this observation that has coding and agent matching. Note that either or both Strings may be null.

Specified by:
findCoding in interface NObservation

addUserCoding

public void addUserCoding(NUserCoding coding)
Add a user coding to the corpus. This is an administration function that allows a user to start a new user coding for this observation

Specified by:
addUserCoding in interface NObservation

getNode

public org.w3c.dom.Node getNode()
Get the DOM node which represents this observation in the tree. Only used by methods that edit the DOM.

Specified by:
getNode in interface NObservation

setNode

public void setNode(org.w3c.dom.Node node)
set the DOM node which represents this observation in the tree. Only used by methods that edit the DOM.

Specified by:
setNode in interface NObservation

setDocument

public void setDocument(org.w3c.dom.Document document)
set the DOM document of which this observation is a part Only used by methods that edit the DOM.

Specified by:
setDocument in interface NObservation