Project Wonder 5.0.0.8794

er.grouping
Class DRSubMasterCriteria

java.lang.Object
  extended by er.grouping.DRSubMasterCriteria

public class DRSubMasterCriteria
extends Object

Defines the specifics of a DRMasterCriteria. How to retrieve the values, how to convert them into values that can be grouped and how to group them into a set of ranges, if required.


Field Summary
protected  String _format
           
protected  boolean _groupEdges
           
protected  boolean _isPeriodic
           
protected  boolean _isPreset
           
protected  String _key
           
protected  String _label
           
protected  boolean _mustSearchForLookup
           
protected  boolean _nonNumberOrDate
           
protected  double _periodicDelta
           
protected static NSArray _possibleUseTypes
          Defines the array of possible groupings.
protected  NSMutableArray _possibleValues
           
protected  String _possibleValuesUseType
           
protected  NSDictionary _presetLookupDict
           
protected  NSArray _rawPossibleValues
           
protected  NSSelector _selKey
           
protected  boolean _useMethod
           
protected  boolean _useTimeFormat
           
protected static Logger log
          Logging support
 
Constructor Summary
DRSubMasterCriteria()
           
DRSubMasterCriteria(NSDictionary smcdict, NSArray apossibleValues)
          Contructor that uses a NSDictionary which defines the properties.
DRSubMasterCriteria(String akey, boolean auseMethod, boolean auseTimeFormat, String aformat, String apossibleValuesUseType, boolean agroupEdges, NSArray apossibleValues)
           
 
Method Summary
 NSDictionary buildPresetLookupDict()
           
 String format()
          When useTimeFormat() is set, then date values will be converted to a string before a comparison by using this format.
 boolean groupEdges()
          Defines if the values not falling into the possibleValues() are also grouped.
 boolean isPeriodic()
           
 boolean isPreset()
           
 String key()
          The key used for retrieving values from the records by.
 String keyDesc()
          Returns the description for the key.
 String label()
           
 String lookUpKeyForValue(Object aVal)
          Converts a given object to a grouping value.
 Object lookUpValueForRecord(DRRecord rec)
           
 boolean mustSearchForLookup()
           
protected  Object newWithDelta(Object val, double delta)
          Returns a new value by adding a delta to it.
 boolean nonNumberOrDate()
           
 NSMutableArray possibleRangeValuesFromRawValues(NSArray rawPossVals)
           
 NSArray possibleUseTypes()
          Returns the array of possible use types.
 NSArray possibleValues()
           
 NSMutableArray possibleValuesToUse()
           
 String possibleValuesUseType()
           
 NSArray rawPossibleValues()
           
 void setFormat(String v)
           
 void setGroupEdges(boolean v)
           
 void setKey(String v)
           
 void setPossibleValuesUseType(String v)
           
 void setRawPossibleValues(NSArray arr)
           
 void setUseMethod(boolean v)
           
 void setUseTimeFormat(boolean v)
           
 String toString()
           
 boolean useMethod()
          Decides if the extration is by method or instance variable.
protected  boolean usePeriodic()
           
protected  boolean usePredefined()
           
protected  boolean useRange()
           
 boolean useTimeFormat()
          Decides if the format() given is used to convert dates into strings before comparison or just compare NSTimestamps.
 NSDictionary valDictFromSearchForLookup(Object aval)
          Will test inbetween'ness, will create new groups for periodics
 NSDictionary valDictMaxMin(Object highVal, Object lowVal)
           
 Object valueForRecord(DRRecord rec)
          Returns the value for the given record.
static DRSubMasterCriteria withDefinitionDictionaryPossibleValues(NSDictionary smcdict, NSArray apossibleValues)
           
static DRSubMasterCriteria withKeyUseMethodUseTimeFormatFormatPossibleValuesUseTypeGroupEdgesPossibleValues(String akey, boolean auseMethod, boolean auseTimeFormat, String aformat, String apossibleValuesUseType, boolean agroupEdges, NSArray apossibleValues)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final Logger log
Logging support


_useMethod

protected boolean _useMethod

_key

protected String _key

_useTimeFormat

protected boolean _useTimeFormat

_possibleUseTypes

protected static final NSArray _possibleUseTypes
Defines the array of possible groupings.


_format

protected String _format

_groupEdges

protected boolean _groupEdges

_rawPossibleValues

protected NSArray _rawPossibleValues

_possibleValues

protected NSMutableArray _possibleValues

_periodicDelta

protected double _periodicDelta

_possibleValuesUseType

protected String _possibleValuesUseType

_isPreset

protected boolean _isPreset

_isPeriodic

protected boolean _isPeriodic

_mustSearchForLookup

protected boolean _mustSearchForLookup

_presetLookupDict

protected NSDictionary _presetLookupDict

_selKey

protected NSSelector _selKey

_nonNumberOrDate

protected boolean _nonNumberOrDate

_label

protected String _label
Constructor Detail

DRSubMasterCriteria

public DRSubMasterCriteria(NSDictionary smcdict,
                           NSArray apossibleValues)
Contructor that uses a NSDictionary which defines the properties.


DRSubMasterCriteria

public DRSubMasterCriteria(String akey,
                           boolean auseMethod,
                           boolean auseTimeFormat,
                           String aformat,
                           String apossibleValuesUseType,
                           boolean agroupEdges,
                           NSArray apossibleValues)

DRSubMasterCriteria

public DRSubMasterCriteria()
Method Detail

withDefinitionDictionaryPossibleValues

public static DRSubMasterCriteria withDefinitionDictionaryPossibleValues(NSDictionary smcdict,
                                                                         NSArray apossibleValues)

withKeyUseMethodUseTimeFormatFormatPossibleValuesUseTypeGroupEdgesPossibleValues

public static DRSubMasterCriteria withKeyUseMethodUseTimeFormatFormatPossibleValuesUseTypeGroupEdgesPossibleValues(String akey,
                                                                                                                   boolean auseMethod,
                                                                                                                   boolean auseTimeFormat,
                                                                                                                   String aformat,
                                                                                                                   String apossibleValuesUseType,
                                                                                                                   boolean agroupEdges,
                                                                                                                   NSArray apossibleValues)

possibleRangeValuesFromRawValues

public NSMutableArray possibleRangeValuesFromRawValues(NSArray rawPossVals)

label

public String label()

buildPresetLookupDict

public NSDictionary buildPresetLookupDict()

nonNumberOrDate

public boolean nonNumberOrDate()

useMethod

public boolean useMethod()
Decides if the extration is by method or instance variable. If this returns true, then only methods will be used to extract values from the raw objects, not their instance variables.


setUseMethod

public void setUseMethod(boolean v)

useTimeFormat

public boolean useTimeFormat()
Decides if the format() given is used to convert dates into strings before comparison or just compare NSTimestamps. If you set this, you should also set a valid NSTimestampFormatter pattern in format().


setUseTimeFormat

public void setUseTimeFormat(boolean v)

groupEdges

public boolean groupEdges()
Defines if the values not falling into the possibleValues() are also grouped. If they are, then they fall into a special High and Low bucket.


setGroupEdges

public void setGroupEdges(boolean v)

key

public String key()
The key used for retrieving values from the records by.


setKey

public void setKey(String v)

format

public String format()
When useTimeFormat() is set, then date values will be converted to a string before a comparison by using this format. The string can be any valid NSTimestampFormatter string, which means that you can also use DateFormatter patterns.


setFormat

public void setFormat(String v)

usePeriodic

protected boolean usePeriodic()

useRange

protected boolean useRange()

usePredefined

protected boolean usePredefined()

possibleValuesUseType

public String possibleValuesUseType()

setPossibleValuesUseType

public void setPossibleValuesUseType(String v)

rawPossibleValues

public NSArray rawPossibleValues()

setRawPossibleValues

public void setRawPossibleValues(NSArray arr)

possibleValues

public NSArray possibleValues()

isPreset

public boolean isPreset()

isPeriodic

public boolean isPeriodic()

mustSearchForLookup

public boolean mustSearchForLookup()

valDictMaxMin

public NSDictionary valDictMaxMin(Object highVal,
                                  Object lowVal)

possibleValuesToUse

public NSMutableArray possibleValuesToUse()

valDictFromSearchForLookup

public NSDictionary valDictFromSearchForLookup(Object aval)
Will test inbetween'ness, will create new groups for periodics


newWithDelta

protected Object newWithDelta(Object val,
                              double delta)
Returns a new value by adding a delta to it. In case of a NSTimestamp, the delta will be seconds, in case of a Number, the delta is added as a double. Otherwise, a conversion to a double is attempted and the delta is added afterwards.


valueForRecord

public Object valueForRecord(DRRecord rec)
Returns the value for the given record. If useMethod() is given, the method is called and no further action is taken if that fails. Otherwise we use NSKeyValueCoding which also considers instance variables.


lookUpValueForRecord

public Object lookUpValueForRecord(DRRecord rec)

lookUpKeyForValue

public String lookUpKeyForValue(Object aVal)
Converts a given object to a grouping value. If case the value if a NSTimestamp, useTimeFormat() is set and format() is a valid date format, the formatted value will returned.


possibleUseTypes

public NSArray possibleUseTypes()
Returns the array of possible use types.


keyDesc

public String keyDesc()
Returns the description for the key.


toString

public String toString()
Overrides:
toString in class Object

Last updated: Thu, Jan 8, 2009 • 12:32 PM EST

Copyright © 2002 – 2007 Project Wonder.