lt.monarch.chart.models
Class AbstractModelValidator

java.lang.Object
  extended by lt.monarch.chart.models.AbstractModelValidator
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DataModelValidator

public abstract class AbstractModelValidator
extends java.lang.Object
implements java.io.Serializable

Abstract data model validator.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  DataColumnType keyType
          Data value type
protected  SortDirection sortDirection
          Sort direction
protected  boolean sortEnabled
          Flag whether to sort the model
protected  boolean validate
          Flag whether to validate the model
 
Constructor Summary
Constructor and Description
AbstractModelValidator()
           
 
Method Summary
Modifier and Type Method and Description
 DataColumnType getKeyType()
          Gets key data value type.
 SortDirection getSortDirection()
          Gets sort direction
abstract  boolean isSorted(DataColumnType keyType, SortDirection direction)
          Checks if the data is sorted according to the axis mapper
 boolean isSortEnabled()
          Gets if the sort of data model is enabled
abstract  boolean isStackConsistent()
          Checks if the stacked data models are consistent
 boolean isValidationEnabled()
           
 void setKeyType(DataColumnType keyType)
          Sets data value type.
 void setSortDirection(SortDirection sortDirection)
          Sets sort direction for the data model
 void setSortEnabled(boolean sortEnabled)
          Sets if the data model sorting is enabled
 void setValidationEnabled(boolean validate)
          Sets whether to validate model
abstract  void validate(DataColumnType keyType)
          Validates data model and sorts the data if required.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

validate

protected boolean validate
Flag whether to validate the model


sortEnabled

protected boolean sortEnabled
Flag whether to sort the model


sortDirection

protected SortDirection sortDirection
Sort direction


keyType

protected DataColumnType keyType
Data value type

Constructor Detail

AbstractModelValidator

public AbstractModelValidator()
Method Detail

isStackConsistent

public abstract boolean isStackConsistent()
Checks if the stacked data models are consistent

Returns:
true if stack is consistent

isSorted

public abstract boolean isSorted(DataColumnType keyType,
                                 SortDirection direction)
Checks if the data is sorted according to the axis mapper

Parameters:
keyType - key type to check
direction - specifies which way data should be sorted
Returns:
true if sorted

validate

public abstract void validate(DataColumnType keyType)
Validates data model and sorts the data if required. If key type for the validator is not set, the one passed here through parameter will be used.

Parameters:
keyType - key value type

setValidationEnabled

public void setValidationEnabled(boolean validate)
Sets whether to validate model

Parameters:
validate - true if to validate

isValidationEnabled

public boolean isValidationEnabled()
Returns:
the validate

getSortDirection

public SortDirection getSortDirection()
Gets sort direction

Returns:
the sort direction

setSortDirection

public void setSortDirection(SortDirection sortDirection)
Sets sort direction for the data model

Parameters:
sortDirection - the sort direction

isSortEnabled

public boolean isSortEnabled()
Gets if the sort of data model is enabled

Returns:
the sortEnabled true if enabled

setSortEnabled

public void setSortEnabled(boolean sortEnabled)
Sets if the data model sorting is enabled

Parameters:
sortEnabled - true if data model sorting is enabled

getKeyType

public DataColumnType getKeyType()
Gets key data value type. Required for sorting data model.

Returns:
key data value type

setKeyType

public void setKeyType(DataColumnType keyType)
Sets data value type. Required for sorting data model.

Parameters:
keyType - key data value type