public class OptimizerUtil
extends java.lang.Object
OptimizerUtil contains methods intended for the analysis and optimization function,
mostly related to the management of sets.| Constructor and Description |
|---|
OptimizerUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
addBraces(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
Return a set elements with braces.
|
static java.lang.String |
addBraces(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
Return a set elements with braces.
|
static java.lang.String |
addNegation(java.lang.String astrExpression)
Add negation to an existing expression.
|
static java.lang.String |
addNegation(java.lang.String astrExpression,
java.util.Locale aLocale)
Add localized negation to an existing expression.
|
static java.lang.String |
getIntersectionSet(java.lang.String astrSetOne,
java.lang.String astrSetTwo,
java.lang.String astrCompleteSet)
Return the intersection of two sets, or a dash if the intersection set contains a complete set of values (and the caller supplies the complete set of
values; if the caller supplies null, dashes are not processed in any special manner).
|
static java.lang.String |
getNot(java.util.Locale aLocale)
Return the "not" operator for the specified locale.
|
static java.lang.String |
getOther(java.util.Locale aLocale)
Return the "other" keyword for the specified locale.
|
static java.lang.String[] |
getSetArray(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
Return an array consisting of the set of values in a caller-supplied if cell.
|
static java.lang.String[] |
getSetArray(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
Return an array consisting of the set of values in a caller-supplied if cell.
|
static java.lang.String |
getSetFromArray(java.lang.String[] astrSetArray,
boolean abMinimizeSpaces)
Convert a caller supplied array of Strings to standard set notation.
|
static java.lang.String |
getSetFromArray(java.lang.String[] astrSetArray,
boolean abMinimizeSpaces,
java.util.Locale aLocale)
Convert a caller supplied array of Strings to standard set notation.
|
static java.lang.String |
getSetFromHashSet(java.util.HashSet ahsSet,
java.lang.String astrCompleteSet)
Convert a caller supplied HashSet to standard set notation.
|
static java.lang.String |
getSetFromHashSet(java.util.HashSet ahsSet,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
Convert a caller supplied HashSet to standard set notation.
|
static java.lang.String |
getSetFromVector(java.util.Vector avectSet)
Convert a caller supplied Vector of Strings to standard set notation.
|
static java.lang.String |
getSetFromVector(java.util.Vector avectSet,
boolean abBase)
Convert a caller supplied Vector of Strings to standard set notation.
|
static java.util.HashSet |
getSetHashSet(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
Return a HashSet consisting of the set of values in a caller-supplied if cell.
|
static java.util.HashSet |
getSetHashSet(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
Return a HashSet consisting of the set of values in a caller-supplied if cell.
|
static java.lang.String |
getSetSeparator(java.util.Locale aLocale)
Return the set delimiter for the specified locale.
|
static java.util.StringTokenizer |
getSetValues(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
Return a StringTokenizer consisting of the set of values in a caller-supplied if cell.
|
static java.util.StringTokenizer |
getSetValues(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
Return a StringTokenizer consisting of the set of values in a caller-supplied if cell.
|
static java.lang.String[] |
getSetValuesFromArray(java.lang.String astrSetContents,
java.lang.String[] aCompleteSetArray)
Build string representation of full values set and calls existing method to make all calculations.
|
static java.lang.String[] |
getSetValuesFromArray(java.lang.String astrSetContents,
java.lang.String[] aCompleteSetArray,
java.util.Locale aLocale)
Build string representation of full values set and calls existing method to make all calculations.
|
static java.util.Vector |
getSetVector(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
Return a Vector consisting of the set of values in a caller-supplied if cell.
|
static java.util.Vector |
getSetVector(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
Return a Vector consisting of the set of values in a caller-supplied if cell.
|
static java.util.Vector |
getStandardSetVector(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
Return a Vector consisting of the set of values in a caller-supplied if cell.
|
static java.util.Vector |
getStandardSetVector(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
boolean lbIgnoreNot) |
static java.lang.String |
getUnionSet(java.lang.String astrSetOne,
java.lang.String astrSetTwo,
java.lang.String astrCompleteSet)
Return the union of two sets, or a dash if the union set contains a complete set of values (and the caller supplies the complete set of values; if the
caller supplies null, dashes are not processed in any special manner).
|
static ValueSet |
getUnionSet(ValueSet aValueSetOne,
ValueSet aValueSetTwo,
ValueSet aValueSetComplete)
Return the union of two sets, or a dash if the union set contains a complete set of values
(and the caller supplies the complete set of values; if the caller supplies null, dashes are
not processed in any special manner).
|
static boolean |
isDecimalColumn(java.lang.String astrColumnHeader)
Determine whether this is a decimal or integer column header.
|
static boolean |
isInSet(java.lang.String astrSet,
java.lang.String astrValue)
Check value to be presented in the set.
|
static boolean |
isNegated(java.lang.String astrExpression)
Returns
true if the expression begins with the not operator. |
static boolean |
isNegated(java.lang.String astrExpression,
java.util.Locale aLocale)
Returns
true if the expression begins with the not operator. |
static boolean |
isSameSet(java.lang.String astrSetOne,
java.lang.String astrSetTwo,
java.lang.String astrCompleteSet)
Compare two sets to determine whether they are logically equal.
|
static boolean |
isSet(java.lang.String astrValue)
Determine whether caller supplied value is a set.
|
static boolean |
isSubset(java.lang.String astrSetOne,
java.lang.String astrSetTwo,
java.lang.String astrCompleteSet)
Determine whether one set is a subset of another and return appropriate boolean value.
|
static boolean |
isSubset(ValueSet aValueSetOne,
ValueSet aValueSetTwo,
ValueSet aValueSetComplete)
Determine whether one set is a subset of another and return appropriate boolean value.
|
static void |
mergeSetElements(java.util.StringTokenizer astValues,
java.util.HashSet ahsSet)
Merge a caller supplied StringTokenizer of strings into a caller-supplied HashSet.
|
static boolean |
overlap(ValueSet aValueSetOne,
ValueSet aValueSetTwo,
ValueSet aValueSetComplete)
Check values for overlap.
|
static java.lang.String |
removeBraces(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
Return a caller-supplied set of elements without braces (if they're present).
|
static java.lang.String |
removeNegation(java.lang.String astrExpression)
Remove negation from expression, if any.
|
static java.lang.String |
removeNegation(java.lang.String astrExpression,
java.util.Locale aLocale)
Remove negation from expression, if any.
|
static java.lang.String |
removeRedundantSetElements(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
Remove redundant set elements from the specified set (if any).
|
static java.lang.String |
removeRedundantSetElements(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
Remove redundant set elements from the specified set (if any).
|
public static boolean isSet(java.lang.String astrValue)
astrValue - Value to check.true if value is a set; otherwise returns false.public static java.lang.String removeRedundantSetElements(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
astrSetContents - Set from which to eliminate redundant values.astrCompleteSet - Complete set of values in standard form (if dash possible) or null.public static java.lang.String removeRedundantSetElements(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
astrSetContents - Set from which to eliminate redundant values.astrCompleteSet - Complete set of values in standard form (if dash possible) or null.aLocale - Locale in which input is expressed.public static java.lang.String getUnionSet(java.lang.String astrSetOne,
java.lang.String astrSetTwo,
java.lang.String astrCompleteSet)
astrSetOne - First set (brace-delimited, comma separated values)astrSetTwo - Second set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values (brace-delimited, comma separated values or null)public static ValueSet getUnionSet(ValueSet aValueSetOne, ValueSet aValueSetTwo, ValueSet aValueSetComplete)
aValueSetOne - First set.aValueSetTwo - Second set.aValueSetComplete - Complete set of possible values.public static java.lang.String getIntersectionSet(java.lang.String astrSetOne,
java.lang.String astrSetTwo,
java.lang.String astrCompleteSet)
astrSetOne - First set (brace-delimited, comma separated values)astrSetTwo - Second set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values (brace-delimited, comma separated values or null)public static boolean isSubset(java.lang.String astrSetOne,
java.lang.String astrSetTwo,
java.lang.String astrCompleteSet)
astrSetOne - First set (brace-delimited, comma separated values)astrSetTwo - Second set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values or nullpublic static boolean isSubset(ValueSet aValueSetOne, ValueSet aValueSetTwo, ValueSet aValueSetComplete)
aValueSetOne - First set.aValueSetTwo - Second set.aValueSetComplete - Complete set of possible values or null.public static boolean isSameSet(java.lang.String astrSetOne,
java.lang.String astrSetTwo,
java.lang.String astrCompleteSet)
astrSetOne - First set (brace-delimited, comma separated values)astrSetTwo - Second set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values or nulltrue if both sets are the samepublic static boolean overlap(ValueSet aValueSetOne, ValueSet aValueSetTwo, ValueSet aValueSetComplete)
aValueSetOne - ValueSet one.aValueSetTwo - ValueSet two.aValueSetComplete - The complete settrue if overlap; otherwise return falsepublic static boolean isInSet(java.lang.String astrSet,
java.lang.String astrValue)
astrSet - The set of elements to checkastrValue - The value that to search fortrue if the value is in the set; otherwise returns falsepublic static boolean isDecimalColumn(java.lang.String astrColumnHeader)
column - Column header stringtrue if decimal header; otherwise return falsepublic static void mergeSetElements(java.util.StringTokenizer astValues,
java.util.HashSet ahsSet)
astValues - List of values to be merged into HashsetahsSet - Hashset to updatepublic static java.util.StringTokenizer getSetValues(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
astrSetContents - Set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values (brace-delimited, comma separated values)public static java.util.StringTokenizer getSetValues(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
astrSetContents - Set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values (brace-delimited, comma separated values)aLocale - Locale in which set is expressed.public static java.util.Vector getSetVector(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
astrSetContents - Set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values (brace-delimited, comma separated values)public static java.util.Vector getSetVector(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
astrSetContents - Set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values (brace-delimited, comma separated values)abBase - Indicates that input string is supplied in base formpublic static java.util.Vector getStandardSetVector(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
astrSetContents - Set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values (brace-delimited, comma separated values)public static java.util.Vector getStandardSetVector(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
boolean lbIgnoreNot)
public static java.lang.String[] getSetArray(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
astrSetContents - Set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values (brace-delimited, comma separated values)public static java.lang.String[] getSetArray(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
astrSetContents - Set (brace-delimited, comma separated values).astrCompleteSet - Complete set of possible values (brace-delimited, comma separated values)aLocale - Locale in which input is expressed.public static java.util.HashSet getSetHashSet(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
astrSetContents - Set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values (brace-delimited, comma separated values)public static java.util.HashSet getSetHashSet(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
astrSetContents - Set (brace-delimited, comma separated values)astrCompleteSet - Complete set of possible values (brace-delimited, comma separated values)aLocale - Locale in which set is expressed.public static java.lang.String getSetFromVector(java.util.Vector avectSet)
avectSet - Vector of set elementspublic static java.lang.String getSetFromVector(java.util.Vector avectSet,
boolean abBase)
avectSet - Vector of set elementsabBase - Return results in base (non-localized) formpublic static java.lang.String getSetFromArray(java.lang.String[] astrSetArray,
boolean abMinimizeSpaces)
astrSetArray - Array of set elements.abMinimizeSpaces - Perform special formatting with minimal spaces.public static java.lang.String getSetFromArray(java.lang.String[] astrSetArray,
boolean abMinimizeSpaces,
java.util.Locale aLocale)
astrSetArray - Array of set elements.abMinimizeSpaces - Perform special formatting with minimal spaces.aLocale - Locale to use for set delimiter.public static java.lang.String getSetFromHashSet(java.util.HashSet ahsSet,
java.lang.String astrCompleteSet)
ahsSet - HashSet of elementsastrCompleteSet - Complete set for condition in standard set notationpublic static java.lang.String getSetFromHashSet(java.util.HashSet ahsSet,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
ahsSet - Set of elementsastrCompleteSet - Complete set for condition in standard set notationaLocale - Locale in which to express results.public static java.lang.String[] getSetValuesFromArray(java.lang.String astrSetContents,
java.lang.String[] aCompleteSetArray)
astrSetContents - Set contents arrayastrCompleteSet - Complete set arraypublic static java.lang.String[] getSetValuesFromArray(java.lang.String astrSetContents,
java.lang.String[] aCompleteSetArray,
java.util.Locale aLocale)
astrSetContents - Set contents arrayastrCompleteSet - Complete set arrayaLocale - Locale in which input is expressed.public static boolean isNegated(java.lang.String astrExpression)
true if the expression begins with the not operator.astrExpression - Expression to check.aLocale - Locale in which string is expressed.true if expression is negated.public static boolean isNegated(java.lang.String astrExpression,
java.util.Locale aLocale)
true if the expression begins with the not operator.astrExpression - Expression to check.aLocale - Locale in which string is expressed.true if expression is negated.public static java.lang.String removeNegation(java.lang.String astrExpression)
astrExpression - Original expression.public static java.lang.String removeNegation(java.lang.String astrExpression,
java.util.Locale aLocale)
astrExpression - Original expression.aLocale - Locale which specifies value of "not" to be supplied.public static java.lang.String addNegation(java.lang.String astrExpression)
astrExpression - Original expression.public static java.lang.String addNegation(java.lang.String astrExpression,
java.util.Locale aLocale)
astrExpression - Original expression.aLocale - Locale which specifies value of "not" to be supplied.public static java.lang.String removeBraces(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
astrSetContents - Value from which to remove bracesastrCompleteSet - Complete set of values in standard form (if dash possible) or nullpublic static java.lang.String addBraces(java.lang.String astrSetContents,
java.lang.String astrCompleteSet)
astrSetContents - String of delimited values to which braces should be addedastrCompleteSet - Complete set of values in standard form (if dash desired) or nullpublic static java.lang.String addBraces(java.lang.String astrSetContents,
java.lang.String astrCompleteSet,
java.util.Locale aLocale)
astrSetContents - String of delimited values to which braces should be addedastrCompleteSet - Complete set of values in standard form (if dash desired) or nullabBase - Return results in base (non-localized) formpublic static java.lang.String getNot(java.util.Locale aLocale)
aLocale - Locale for which "not" operator should be returned (Constants.LOCALE_BASE for base).public static java.lang.String getOther(java.util.Locale aLocale)
aLocale - Locale for which "other" keyword should be returned (Constants.LOCALE_BASE for base).public static java.lang.String getSetSeparator(java.util.Locale aLocale)
aLocale - Locale for which set delimiter should be returned (Constants.LOCALE_BASE for base).Copyright © 2005-2016 Progress Software Corporation and/or its subsidiaries and affiliates. All rights reserved.