edu.iastate.metnet.graphmodel
Class GraphValidity

java.lang.Object
  extended by edu.iastate.metnet.graphmodel.GraphValidity

public class GraphValidity
extends java.lang.Object

store the information of the graph validity

Author:
Jie Li

Field Summary
static java.lang.String ERROR_ADJACENT_ENTITY
          adjacent entities
static java.lang.String ERROR_DUPLICATE_ENTITY
          duplicate entity error message
static java.lang.String ERROR_ENZYME_TYPE
          enzyme type error message
static java.lang.String ERROR_GENE_LOCATION
          gene location error message
static java.lang.String ERROR_INTERACTION_STRUCTURE
          interaction structure error message
static java.lang.String ERROR_NODE_USER_OBJECT
          user object error message
static java.lang.String ERROR_NOTHING
          no errors
static java.lang.String ERROR_ORPHAN_NODE
          orphan node
static java.lang.String ERROR_TRANSPORT_LOCATION
          transport location error message
(package private) static org.apache.log4j.Logger logger
          log4j facility
static java.lang.String WARNING_ADJACENT_INTERACTION
          adjacent interaction.
static java.lang.String WARNING_DUPLICATE_INTERACTION
          duplicate interaction warning message
static java.lang.String WARNING_NOTHING
          no warnings
static java.lang.String WARNING_UNKNOWN_LOCATION
          unknown location
static java.lang.String WARNING_UNSUPPORTED_ORGANISM
          unsupported species
 
Constructor Summary
GraphValidity()
          default constructor
 
Method Summary
 void clear()
          clear error message
 void error(java.lang.Integer modelId, java.lang.String message)
          add one error
 java.lang.String getErrorMessage(java.lang.Integer modelId)
          get the error message for model id
 java.util.Map getErrors()
          get the errors
 java.lang.String getWarningMessage(java.lang.Integer modelId)
          get the warning message for model id
 java.util.Map getWarnings()
          get the warnings
 boolean isPerfect()
          if there is no error and no warning, used for highlight
 boolean isValid()
          if the current informaiton is valid, used for saving
 boolean isValid(java.lang.Integer modelId)
          detect if the model id represents a correct data entry
 void warn(java.lang.Integer modelId, java.lang.String message)
          add one warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
log4j facility


ERROR_NODE_USER_OBJECT

public static final java.lang.String ERROR_NODE_USER_OBJECT
user object error message

See Also:
Constant Field Values

ERROR_GENE_LOCATION

public static final java.lang.String ERROR_GENE_LOCATION
gene location error message

See Also:
Constant Field Values

ERROR_ENZYME_TYPE

public static final java.lang.String ERROR_ENZYME_TYPE
enzyme type error message

See Also:
Constant Field Values

ERROR_TRANSPORT_LOCATION

public static final java.lang.String ERROR_TRANSPORT_LOCATION
transport location error message

See Also:
Constant Field Values

ERROR_DUPLICATE_ENTITY

public static final java.lang.String ERROR_DUPLICATE_ENTITY
duplicate entity error message

See Also:
Constant Field Values

WARNING_DUPLICATE_INTERACTION

public static final java.lang.String WARNING_DUPLICATE_INTERACTION
duplicate interaction warning message

See Also:
Constant Field Values

ERROR_INTERACTION_STRUCTURE

public static final java.lang.String ERROR_INTERACTION_STRUCTURE
interaction structure error message

See Also:
Constant Field Values

ERROR_ADJACENT_ENTITY

public static final java.lang.String ERROR_ADJACENT_ENTITY
adjacent entities

See Also:
Constant Field Values

WARNING_ADJACENT_INTERACTION

public static final java.lang.String WARNING_ADJACENT_INTERACTION
adjacent interaction. This is a warning because some enzymes catalysis the transport in Acetyl-CoA biotin network. We need the biologists to look at the data.

See Also:
Constant Field Values

ERROR_ORPHAN_NODE

public static final java.lang.String ERROR_ORPHAN_NODE
orphan node

See Also:
Constant Field Values

WARNING_UNKNOWN_LOCATION

public static final java.lang.String WARNING_UNKNOWN_LOCATION
unknown location

See Also:
Constant Field Values

WARNING_UNSUPPORTED_ORGANISM

public static final java.lang.String WARNING_UNSUPPORTED_ORGANISM
unsupported species

See Also:
Constant Field Values

ERROR_NOTHING

public static final java.lang.String ERROR_NOTHING
no errors

See Also:
Constant Field Values

WARNING_NOTHING

public static final java.lang.String WARNING_NOTHING
no warnings

See Also:
Constant Field Values
Constructor Detail

GraphValidity

public GraphValidity()
default constructor

Method Detail

getErrorMessage

public java.lang.String getErrorMessage(java.lang.Integer modelId)
get the error message for model id

Parameters:
modelId - the blockid of the graph cell
Returns:
the error message

getWarningMessage

public java.lang.String getWarningMessage(java.lang.Integer modelId)
get the warning message for model id

Parameters:
modelId - the blockid of the graph cell
Returns:
the warning message

clear

public void clear()
clear error message


getErrors

public java.util.Map getErrors()
get the errors

Returns:
the errors

getWarnings

public java.util.Map getWarnings()
get the warnings

Returns:
the warning

isValid

public boolean isValid()
if the current informaiton is valid, used for saving

Returns:
true if no errors and no warnings

isPerfect

public boolean isPerfect()
if there is no error and no warning, used for highlight

Returns:
true if perfect, false if not

isValid

public boolean isValid(java.lang.Integer modelId)
detect if the model id represents a correct data entry

Parameters:
modelId - the model id
Returns:
true if it is correct, false if not

error

public void error(java.lang.Integer modelId,
                  java.lang.String message)
add one error

Parameters:
message - the error message

warn

public void warn(java.lang.Integer modelId,
                 java.lang.String message)
add one warning

Parameters:
message - the warning message