public class DRSubMasterCriteria extends Object
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.Modifier and Type | Field and Description |
---|---|
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 |
Constructor and Description |
---|
DRSubMasterCriteria() |
DRSubMasterCriteria(NSDictionary smcdict,
NSArray apossibleValues)
Constructor that uses a
NSDictionary which defines the properties. |
DRSubMasterCriteria(String akey,
boolean auseMethod,
boolean auseTimeFormat,
String aformat,
String apossibleValuesUseType,
boolean agroupEdges,
NSArray apossibleValues) |
Modifier and Type | Method and Description |
---|---|
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 extraction 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 NSTimestamp . |
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) |
protected boolean _useMethod
protected String _key
protected boolean _useTimeFormat
protected static final NSArray _possibleUseTypes
protected String _format
protected boolean _groupEdges
protected NSArray _rawPossibleValues
protected NSMutableArray _possibleValues
protected double _periodicDelta
protected String _possibleValuesUseType
protected boolean _isPreset
protected boolean _isPeriodic
protected boolean _mustSearchForLookup
protected NSDictionary _presetLookupDict
protected NSSelector _selKey
protected boolean _nonNumberOrDate
protected String _label
public DRSubMasterCriteria(NSDictionary smcdict, NSArray apossibleValues)
NSDictionary
which defines the properties.public DRSubMasterCriteria(String akey, boolean auseMethod, boolean auseTimeFormat, String aformat, String apossibleValuesUseType, boolean agroupEdges, NSArray apossibleValues)
public DRSubMasterCriteria()
public static DRSubMasterCriteria withDefinitionDictionaryPossibleValues(NSDictionary smcdict, NSArray apossibleValues)
public static DRSubMasterCriteria withKeyUseMethodUseTimeFormatFormatPossibleValuesUseTypeGroupEdgesPossibleValues(String akey, boolean auseMethod, boolean auseTimeFormat, String aformat, String apossibleValuesUseType, boolean agroupEdges, NSArray apossibleValues)
public NSMutableArray possibleRangeValuesFromRawValues(NSArray rawPossVals)
public String label()
public NSDictionary buildPresetLookupDict()
public boolean nonNumberOrDate()
public boolean useMethod()
public void setUseMethod(boolean v)
public boolean useTimeFormat()
format()
given is used to convert dates
into strings before comparison or just compare NSTimestamp
.
If you set this, you should also set a valid NSTimestampFormatter
pattern in format()
.public void setUseTimeFormat(boolean v)
public boolean groupEdges()
possibleValues()
are also grouped.
If they are, then they fall into a special High and Low bucket.public void setGroupEdges(boolean v)
public String key()
public void setKey(String v)
public String format()
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 DateFormat
patterns.public void setFormat(String v)
protected boolean usePeriodic()
protected boolean useRange()
protected boolean usePredefined()
public String possibleValuesUseType()
public void setPossibleValuesUseType(String v)
public NSArray rawPossibleValues()
public void setRawPossibleValues(NSArray arr)
public NSArray possibleValues()
public boolean isPreset()
public boolean isPeriodic()
public boolean mustSearchForLookup()
public NSDictionary valDictMaxMin(Object highVal, Object lowVal)
public NSMutableArray possibleValuesToUse()
public NSDictionary valDictFromSearchForLookup(Object aval)
protected Object newWithDelta(Object val, double delta)
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.public Object valueForRecord(DRRecord rec)
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.public String lookUpKeyForValue(Object aVal)
NSTimestamp
,
useTimeFormat()
is set and format()
is a valid date format, the formatted value will returned.public NSArray possibleUseTypes()
Copyright © 2002 – 2024 Project Wonder.