PIRL

PIRL.PVL
Class Selection

java.lang.Object
  extended by PIRL.PVL.Selection
All Implemented Interfaces:
Selector

public class Selection
extends Object
implements Selector

A Selection implements a Selector for use with a Parameter or Value wherever selective comparison of Parameters and/or Values is needed.

For example, both the Parameter and Value Find methods use a Selector when making object comparisons, and use this Selection class when no other Selector is specified. A Selection can be used to specify the criteria to be used in comparing all, or any part, of two Parameters or Values.

The criteria are specified as the characteristics of the Parameter and/or Value to use in making a selection, and the combinatorial boolean logic to apply to the characteristics when comparing one object against another. The Selector interface defines the criteria symbols. The Selection class provides the definition of the criteria and comparison methods.

Version:
1.13
Author:
Bradford Castalia, UA/PIRL

Field Summary
static String ID
          Class name and version identification.
 
Fields inherited from interface PIRL.PVL.Selector
AND, ANY, ANY_PARAMETER, ANY_VALUE, BASE, CLASSIFICATION, COMMENTS, DATA, EQUAL, GREATER_THAN, LESS_THAN, LOGIC, MODIFIERS, NAME, PARAMETER_MATCH, PARAMETER_SELECTION, PATTERN_MATCH, SPECIFIC, TYPE, UNITS, VALUE, VALUE_MATCH, VALUE_SELECTION
 
Constructor Summary
Selection()
          Creates a Selection using ANY criteria.
Selection(int criteria)
          Creates a Selection using the specified criteria.
Selection(Selector selector)
          Creates a Selection using the criteria from the specified Selector.
 
Method Summary
 boolean And()
          Tests if logical AND for multiple criteria is enabled.
 Selector And(boolean mode)
          Enables or disables logical AND when matching with multiple criteria.
 boolean Any_Parameter()
          Tests if any Parameter characteristic will match.
 Selector Any_Parameter(boolean mode)
          Enables or disables using any Parameter characteristic to match.
 boolean Any_Value()
          Tests if any Value characteristic will match.
 Selector Any_Value(boolean mode)
          Enables or disables using any Value characteristic to match.
 boolean Base()
          Tests if the Value integer base criteria is enabled.
 Selector Base(boolean mode)
          Enables or disables the Value integer base criteria.
 boolean Bases_Match(Value this_value, Value that_value)
          Tests if the integer radix base values of two Values match.
 boolean Classification()
          Tests if the Parameter classification criteria is enabled.
 Selector Classification(boolean mode)
          Enables or disables the Parameter classification criteria.
 boolean Classifications_Match(Parameter this_parameter, Parameter that_parameter)
          Tests if the classifications of two Parameters match.
 boolean Comments_Match(Parameter this_parameter, Parameter that_parameter)
          Tests if the comments of two Parameters match.
 boolean Comments()
          Tests if the Parameter comments criteria is enabled.
 Selector Comments(boolean mode)
          Enables or disables the Parameter comments criteria.
 int Criteria()
          Gets the current Selection criteria code.
 Selector Criteria(int criteria)
          Sets Selection criteria to the specified code.
 boolean Data_Match(Value this_value, Value that_value)
          Tests if the data of two Values match.
 boolean Data()
          Tests if the data of a Value is a criteria.
 Selector Data(boolean mode)
          Enables or disables using the data of a Value as a criteria.
 boolean Equal()
          Tests if equality matching logic is enabled.
 Selector Equal(boolean mode)
          Enables or disables using equality logic for comparing Values with NUMERIC data.
 boolean Greater_Than()
          Tests if greater-than matching logic is enabled.
 Selector Greater_Than(boolean mode)
          Enables or disables using greater-than logic for comparing Values with NUMERIC data.
 boolean Less_Than()
          Tests if less-than matching logic is enabled.
 Selector Less_Than(boolean mode)
          Enables or disables using less-than logic for comparing Values with NUMERIC data.
 int Logic()
          Gets the logic settings of the current Selection criteria code.
 int Modifiers()
          Gets the modifiers of the current Selection criteria code.
 boolean Name()
          Tests if the Parameter name criteria is enabled.
 Selector Name(boolean mode)
          Enables or disables the Parameter name criteria.
 boolean Names_Match(Parameter this_parameter, Parameter that_parameter)
          Tests if the names of two Parameters match.
 int Parameter_Criteria()
          Gets the current Parameter Selection criteria code.
 boolean Parameter_Values_Match(Parameter this_parameter, Parameter that_parameter)
          Tests if the data values of two Parameters match.
 int Parameters_Criteria_Match(Parameter this_parameter, Parameter that_parameter)
          Gets the matching criteria for two Parameters.
 int Parameters_Match()
          Gets the selection criteria that resulted from the last Parameters_Match comparison of two Parameters.
 boolean Parameters_Match(Parameter this_parameter, Parameter that_parameter)
          Tests if two Parameters match.
 boolean Pattern_Match()
          Tests if regular expression pattern matching is enabled.
 Selector Pattern_Match(boolean mode)
          Enables or disables using regular expression pattern matching for String comparisons.
 boolean Specific()
          Tests if specific criteria matching is enabled.
 Selector Specific(boolean mode)
          Enables or disables specific criteria matching.
 String toString()
          Gets a description of the Selection criteria.
 boolean Type()
          Tests if the Value type criteria is enabled.
 Selector Type(boolean mode)
          Enables or disables the Value type criteria.
 boolean Types_Match(Value this_value, Value that_value)
          Tests if the types of two Values match.
 boolean Units_Match(Value this_value, Value that_value)
          Tests if the units descriptions of two Values match.
 boolean Units()
          Tests if the Value units description criteria is enabled.
 Selector Units(boolean mode)
          Enables or disables the Value units description criteria.
 int Value_Criteria()
          Gets the current Value Selection criteria code.
 boolean Value()
          Tests if the Parameter Value criteria is enabled.
 Selector Value(boolean mode)
          Enables or disables the Parameter Value criteria.
 int Values_Criteria_Match(Value this_value, Value that_value)
          Gets the matching criteria for two Values.
 int Values_Match()
          Gets the selection criteria that resulted from the last Values_Match comparison of two Values.
 boolean Values_Match(Value this_value, Value that_value)
          Tests if two Values match.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class name and version identification.

See Also:
Constant Field Values
Constructor Detail

Selection

public Selection()
Creates a Selection using ANY criteria.

This Selection will match anything; i.e. any two Parameters or Values will always match with this Selection.


Selection

public Selection(int criteria)
Creates a Selection using the specified criteria.

The criteria code may be any combination of Selector criteria.

Parameters:
criteria - A Selector criteria code value.
See Also:
Selector

Selection

public Selection(Selector selector)
Creates a Selection using the criteria from the specified Selector.

Parameters:
selector - The Selector from which to get the criteria to use.
Method Detail

Criteria

public Selector Criteria(int criteria)
Sets Selection criteria to the specified code.

Specified by:
Criteria in interface Selector
Parameters:
criteria - The Selector criteria to use.
Returns:
This Selection.
See Also:
Selector

Criteria

public int Criteria()
Gets the current Selection criteria code.

Specified by:
Criteria in interface Selector
Returns:
The current Selection criteria code.

Parameter_Criteria

public int Parameter_Criteria()
Gets the current Parameter Selection criteria code.

Only that portion of the current Selection criteria code for the PARAMETER_SELECTION is returned; all other criteria are masked out.

Specified by:
Parameter_Criteria in interface Selector
Returns:
The PARAMETER_SELECTION section of the current Selection criteria.
See Also:
Selector.PARAMETER_SELECTION

Value_Criteria

public int Value_Criteria()
Gets the current Value Selection criteria code.

Only that portion of the current Selection criteria code for the VALUE_SELECTION is returned; all other criteria are masked out.

Specified by:
Value_Criteria in interface Selector
Returns:
The VALUE_SELECTION section of the current Selection criteria.
See Also:
Selector.VALUE_SELECTION

Modifiers

public int Modifiers()
Gets the modifiers of the current Selection criteria code.

Only that portion of the current Selection criteria code for the MODIFIERS is returned; all other criteria are masked out.

Specified by:
Modifiers in interface Selector
Returns:
The MODIFIERS section of the current Selection criteria.
See Also:
Selector.MODIFIERS

Logic

public int Logic()
Gets the logic settings of the current Selection criteria code.

Only that portion of the current Selection criteria code for the LOGIC is returned; all other criteria are masked out.

Specified by:
Logic in interface Selector
Returns:
The LOGIC section of the current Selection criteria.
See Also:
Selector.LOGIC

toString

public String toString()
Gets a description of the Selection criteria.

Specified by:
toString in interface Selector
Overrides:
toString in class Object

Name

public Selector Name(boolean mode)
Enables or disables the Parameter name criteria.

Specified by:
Name in interface Selector
Parameters:
mode - true to enable the use of the Parameter name as a match criteria; false to disable this criteria.
Returns:
This Selection.
See Also:
Selector.NAME

Name

public boolean Name()
Tests if the Parameter name criteria is enabled.

Specified by:
Name in interface Selector
Returns:
true if the criteria is enabled; false otherwise.
See Also:
Name(boolean)

Classification

public Selector Classification(boolean mode)
Enables or disables the Parameter classification criteria.

Specified by:
Classification in interface Selector
Parameters:
mode - true to enable the use of the Parameter classification as a match criteria; false to disable this criteria.
Returns:
This Selection.
See Also:
Selector.CLASSIFICATION

Classification

public boolean Classification()
Tests if the Parameter classification criteria is enabled.

Specified by:
Classification in interface Selector
Returns:
true if the criteria is enabled; false otherwise.
See Also:
Classification(boolean)

Value

public Selector Value(boolean mode)
Enables or disables the Parameter Value criteria.

Specified by:
Value in interface Selector
Parameters:
mode - true to enable the use of the Parameter Value as a match criteria; false to disable this criteria.
Returns:
This Selection.
See Also:
Selector.VALUE

Value

public boolean Value()
Tests if the Parameter Value criteria is enabled.

Specified by:
Value in interface Selector
Returns:
true if the criteria is enabled; false otherwise.
See Also:
Value(boolean)

Comments

public Selector Comments(boolean mode)
Enables or disables the Parameter comments criteria.

Specified by:
Comments in interface Selector
Parameters:
mode - true to enable the use of the Parameter comments as a match criteria; false to disable this criteria.
Returns:
This Selection.
See Also:
Selector.COMMENTS

Comments

public boolean Comments()
Tests if the Parameter comments criteria is enabled.

Specified by:
Comments in interface Selector
Returns:
true if the criteria is enabled; false otherwise.
See Also:
Comments(boolean)

Any_Parameter

public Selector Any_Parameter(boolean mode)
Enables or disables using any Parameter characteristic to match.

Enabling this mode will disable all Parameter criteria, which is a special case interpreted to mean that any Parameter characteristic matches with those of another Parameter. If, however, AND logic is enabled then the Value matching criteria must still be met. Disabling this mode has no effect; specific Parameter criteria must be enabled once Any_Parameter has been used.

Specified by:
Any_Parameter in interface Selector
Parameters:
mode - true to enable any Parameter characteristics to match; false leaves the current criteria unchanged.
Returns:
This Selection.
See Also:
Selector.PARAMETER_SELECTION

Any_Parameter

public boolean Any_Parameter()
Tests if any Parameter characteristic will match.

Specified by:
Any_Parameter in interface Selector
Returns:
true if no Parameter criteria are enabled; false otherwise.
See Also:
Any_Parameter(boolean)

Data

public Selector Data(boolean mode)
Enables or disables using the data of a Value as a criteria.

Specified by:
Data in interface Selector
Parameters:
mode - true to enable the use of Value data as a match criteria; false to disable this criteria.
Returns:
This Selection.
See Also:
Selector.DATA

Data

public boolean Data()
Tests if the data of a Value is a criteria.

Specified by:
Data in interface Selector
Returns:
true if the data of a Value is a criteria; false otherwise.
See Also:
Data(boolean)

Type

public Selector Type(boolean mode)
Enables or disables the Value type criteria.

Specified by:
Type in interface Selector
Parameters:
mode - true to enable the use of the Value type as a match criteria; false to disable this criteria.
Returns:
This Selection.
See Also:
Selector.TYPE

Type

public boolean Type()
Tests if the Value type criteria is enabled.

Specified by:
Type in interface Selector
Returns:
true if the criteria is enabled; false otherwise.
See Also:
Type(boolean)

Base

public Selector Base(boolean mode)
Enables or disables the Value integer base criteria.

Specified by:
Base in interface Selector
Parameters:
mode - true to enable the use of the Value integer base as a match criteria; false to disable this criteria.
Returns:
This Selection.
See Also:
Selector.BASE

Base

public boolean Base()
Tests if the Value integer base criteria is enabled.

Specified by:
Base in interface Selector
Returns:
true if the criteria is enabled; false otherwise.
See Also:
Base(boolean)

Units

public Selector Units(boolean mode)
Enables or disables the Value units description criteria.

Specified by:
Units in interface Selector
Parameters:
mode - true to enable the use of the Value units description as a match criteria; false to disable this criteria.
Returns:
This Selection.
See Also:
Selector.UNITS

Units

public boolean Units()
Tests if the Value units description criteria is enabled.

Specified by:
Units in interface Selector
Returns:
true if the criteria is enabled; false otherwise.
See Also:
Units(boolean)

Any_Value

public Selector Any_Value(boolean mode)
Enables or disables using any Value characteristic to match.

Enabling this mode will disable all Value criteria, which is a special case interpreted to mean that any Value characteristic matches with those of another Value. Disabling this mode has no effect; specific Value criteria must be enabled once Any_Value has been used.

Specified by:
Any_Value in interface Selector
Parameters:
mode - true to enable any Value characteristics to match; false leaves the current criteria unchanged.
Returns:
This Selection.
See Also:
Selector.VALUE_SELECTION

Any_Value

public boolean Any_Value()
Tests if any Value characteristic will match.

Specified by:
Any_Value in interface Selector
Returns:
true if no Value criteria are enabled; false otherwise.
See Also:
Any_Value(boolean)

Pattern_Match

public Selector Pattern_Match(boolean mode)
Enables or disables using regular expression pattern matching for String comparisons.

Specified by:
Pattern_Match in interface Selector
Parameters:
mode - true to enable pattern matching; false otherwise.
Returns:
This Selection.
See Also:
Selector.PATTERN_MATCH

Pattern_Match

public boolean Pattern_Match()
Tests if regular expression pattern matching is enabled.

Specified by:
Pattern_Match in interface Selector
Returns:
true if the criteria is enabled; false otherwise.
See Also:
Pattern_Match(boolean)

Specific

public Selector Specific(boolean mode)
Enables or disables specific criteria matching.

When specific matching is enabled Parameter classifications and Value types must match exactly; when disabled only the general categories need to be the same for their criteria to be met. When specific matching is enabled Strings are compared using their equals methods; when disabled their equalsIgnoreCase methods are used. When specific matching is enabled aggregate Parameter lists are compared in their entirerty; when disabled END Parameters are recognized as the end of a list and an END_PVL Parameter marks the end of all nested lists.

Specified by:
Specific in interface Selector
Parameters:
mode - true to require criteria to match exactly; false will allow criteria to match when the characteristics are generally the same.
Returns:
This Selection.
See Also:
Selector.SPECIFIC

Specific

public boolean Specific()
Tests if specific criteria matching is enabled.

Specified by:
Specific in interface Selector
Returns:
true if specific criteria matching is enabled; false otherwise.
See Also:
Specific(boolean)

Equal

public Selector Equal(boolean mode)
Enables or disables using equality logic for comparing Values with NUMERIC data.

Specified by:
Equal in interface Selector
Parameters:
mode - true to use equality logic when comparing numeric data values.
Returns:
This Selection.
See Also:
Selector.SPECIFIC

Equal

public boolean Equal()
Tests if equality matching logic is enabled.

Specified by:
Equal in interface Selector
Returns:
true if equality matching logic is enabled; false otherwise.
See Also:
Specific(boolean)

Less_Than

public Selector Less_Than(boolean mode)
Enables or disables using less-than logic for comparing Values with NUMERIC data.

If Equal is also enabled, then <= logic will be used. Note: This method disables Greater_Than logic.

Specified by:
Less_Than in interface Selector
Parameters:
mode - true to use less-than logic when comparing numeric data values.
Returns:
This Selection.
See Also:
Selector.LESS_THAN

Less_Than

public boolean Less_Than()
Tests if less-than matching logic is enabled.

Specified by:
Less_Than in interface Selector
Returns:
true if less-than matching logic is enabled; false otherwise.
See Also:
Less_Than(boolean)

Greater_Than

public Selector Greater_Than(boolean mode)
Enables or disables using greater-than logic for comparing Values with NUMERIC data.

If Equal is also enabled, then >= logic will be used; however, Less_Than takes precedence if they are both enabled. Note: This method disables Less_Than logic.

Specified by:
Greater_Than in interface Selector
Parameters:
mode - true to use less-than logic when comparing numeric data values.
Returns:
This Selection.
See Also:
Selector.LESS_THAN

Greater_Than

public boolean Greater_Than()
Tests if greater-than matching logic is enabled.

Specified by:
Greater_Than in interface Selector
Returns:
true if greater-than matching logic is enabled; false otherwise.
See Also:
Greater_Than(boolean)

And

public Selector And(boolean mode)
Enables or disables logical AND when matching with multiple criteria.

Note: When disabled, logical OR is used when matching with multiple criteria.

Specified by:
And in interface Selector
Parameters:
mode - true to use logical AND when matching with multiple criteria; false to use logical OR.
Returns:
This Selection.
See Also:
Selector.AND

And

public boolean And()
Tests if logical AND for multiple criteria is enabled.

Specified by:
And in interface Selector
Returns:
true if AND logic is enabled; false if OR logic will be used.
See Also:
And(boolean)

Parameters_Match

public boolean Parameters_Match(Parameter this_parameter,
                                Parameter that_parameter)
Tests if two Parameters match.

If both arguments are null, they match; but if one or the other is null, they do not match.

When Any_Parameter is enabled, a match occurs. However, if And is also enabled and Any_Value is not enabled, then a match only occurs if both Parameters are the ASSIGNMENT classification and their Values_Match.

The following criteria are tested in the order listed:

  1. Classification - Classifications_Match
  2. Value - Parameter_Values_Match
  3. Comments - Comments_Match
  4. Name - Names_Match

When And logic is enabled, all of these criteria tests must match for the Parameters to match (the first one that does not match stops further testing); otherwise any criteria test that matches produces a match for the Parameters (the first one that matches stops further testing).

N.B.: When the associativity of comparison testing matters - e.g. - the associativity is this_parameter op that_parameter. For example, when a Parameter name is being compared against a regular expression pattern the comparison is this_parameter.Name ().matches (that_parameter.Name ()); i.e. the second Parameter (that_parameter) is expected to contain the pattern to be matched.

N.B.: Parameter matching of Aggregates is only recursive for Value matching, and in this case only the Values of the Parameter lists are compared.

Specified by:
Parameters_Match in interface Selector
Parameters:
this_parameter - The first of a pair of Parameters to be matched.
that_parameter - The second of a pair of Parameters to be matched.
Returns:
true if the Parameters match; false otherwise.
See Also:
And(boolean), Any_Parameter(boolean), Any_Value(boolean), Parameter.ASSIGNMENT, Values_Match(Value, Value), Classification(boolean), Classifications_Match(Parameter, Parameter), Value(boolean), Parameter_Values_Match(Parameter, Parameter), Comments(boolean), Comments_Match(Parameter, Parameter), Name(boolean), Names_Match(Parameter, Parameter)

Parameters_Match

public int Parameters_Match()
Gets the selection criteria that resulted from the last Parameters_Match comparison of two Parameters.

The Selector criteria code that is returned flags the criteria that were matched during the last use of the Parameters_Match method with this Selection object. If no match occured the return value will be zero.

Specified by:
Parameters_Match in interface Selector
Returns:
A Selector criteria code.

Parameters_Criteria_Match

public int Parameters_Criteria_Match(Parameter this_parameter,
                                     Parameter that_parameter)
Gets the matching criteria for two Parameters.

The same matching logic as used in the Parameters_Match method is applied here, except that all criteria are tested. Thus the Selector criteria code that is returned indicates all matching criteria. When the Value criteria is enabled and the Parameters are the ASSIGNMENT classification, then the Values_Criteria_Match method is used to also get the matching criteria for the Parameters' Values. If no criteria match the return value will be zero.

Specified by:
Parameters_Criteria_Match in interface Selector
Parameters:
this_parameter - The first of a pair of Parameters to be matched.
that_parameter - The second of a pair of Parameters to be matched.
Returns:
A Selector criteria code.
See Also:
Parameters_Match(Parameter, Parameter), Values_Criteria_Match(Value, Value)

Names_Match

public boolean Names_Match(Parameter this_parameter,
                           Parameter that_parameter)
Tests if the names of two Parameters match.

If Pattern_Matching is enabled, then the Name of this_parameter is compared against the regular expression pattern in the Name of that_parameter. If the regular expression syntax is invalid a normal String comparision is done. If Specific matching is enabled, then the String equals method is used; otherwise the equalsIgnoreCase method is used.

N.B.: If either Parameter is null the match is false.

Specified by:
Names_Match in interface Selector
Parameters:
this_parameter - The first of a pair of Parameters to be matched.
that_parameter - The second of a pair of Parameters to be matched.
Returns:
true if the Parameter names match; false otherwise.
See Also:
String.matches(String)

Classifications_Match

public boolean Classifications_Match(Parameter this_parameter,
                                     Parameter that_parameter)
Tests if the classifications of two Parameters match.

If Specific matching is enabled, then the classifications must be identical to match; otherwise general classifications (i.e. AGGREGATE) will also match.

N.B.: If either Parameter is null the match is false.

Specified by:
Classifications_Match in interface Selector
Parameters:
this_parameter - The first of a pair of Parameters to be matched.
that_parameter - The second of a pair of Parameters to be matched.
Returns:
true if the Parameter classifications match; false otherwise.

Parameter_Values_Match

public boolean Parameter_Values_Match(Parameter this_parameter,
                                      Parameter that_parameter)
Tests if the data values of two Parameters match.

If both Parameters have null data values, they match; but if one or the other is null, they do not match.

For an ASSIGNMENT, Values_Match determines the match.

For AGGREGATE Parameters, all of the Parameters in the aggregate lists must match, using the current Selection criteria, for a match to occur. However, if Specific matching is not enabled, then END Parameters are recognized as ending lists, and an END_PVL Parameter will stop any further comparisons for all nested aggregate lists. If the Value criteria applies then the match is recursive for all Aggregate Parameters. TOKEN and UNKNOWN Parameter Values always match when their classifications are the same.

N.B.: If either Parameter is null the match is false.

Specified by:
Parameter_Values_Match in interface Selector
Parameters:
this_parameter - The first of a pair of Parameters to be matched.
that_parameter - The second of a pair of Parameters to be matched.
Returns:
true if the Parameter data values match; false otherwise.
See Also:
Values_Match(Value, Value), Specific(boolean)

Comments_Match

public boolean Comments_Match(Parameter this_parameter,
                              Parameter that_parameter)
Tests if the comments of two Parameters match.

If both Parameters do not have comments, they match; but if one or the other does not have comments, they do not match. If Specific matching is enabled, then the String equals method is used; otherwise the equalsIgnoreCase method is used.

N.B.: If either Parameter is null the match is false.

Specified by:
Comments_Match in interface Selector
Parameters:
this_parameter - The first of a pair of Parameters to be matched.
that_parameter - The second of a pair of Parameters to be matched.
Returns:
true if the Parameter comments match; false otherwise.

Values_Match

public boolean Values_Match(Value this_value,
                            Value that_value)
Tests if two Values match.

When Any_Value is enabled, a match always occurs.

If both arguments are null, they match; but if one or the other is null, they do not match.

The following criteria are tested in the order listed:

  1. Type - Types_Match
  2. Base - Bases_Match
  3. Units - Units_Match
  4. Data - Data_Match

When And logic is enabled, all of the enabled criteria tests must match for the Values to match (the first one that does not match stops further testing); otherwise any criteria test that matches produces a match for the Values (the first one that matches stops further testing).

N.B.: Value matching of Arrays is only recursive for Data matching, and in this case only the data values of the Array elements are compared.

Specified by:
Values_Match in interface Selector
Parameters:
this_value - The first of a pair of Values to be matched.
that_value - The second of a pair of Values to be matched.
Returns:
true if the Values match; false otherwise.
See Also:
And(boolean), Type(boolean), Types_Match(Value, Value), Base(boolean), Bases_Match(Value, Value), Units(boolean), Units_Match(Value, Value), Data(boolean), Data_Match(Value, Value)

Values_Match

public int Values_Match()
Gets the selection criteria that resulted from the last Values_Match comparison of two Values.

The Selector criteria code that is returned flags the criteria that were matched during the last use of the Values_Match method with this Selection object. If no match occured the return value will be zero.

Specified by:
Values_Match in interface Selector
Returns:
A Selector criteria code.

Values_Criteria_Match

public int Values_Criteria_Match(Value this_value,
                                 Value that_value)
Gets the matching criteria for two Values.

The same matching logic as used in the Values_Match method is applied here, except that all criteria are tested. Thus the Selector criteria code that is returned indicates all matching criteria. If no criteria match the return value will be zero.

Specified by:
Values_Criteria_Match in interface Selector
Parameters:
this_value - The first of a pair of Values to be matched.
that_value - The second of a pair of Values to be matched.
Returns:
A Selector criteria code.
See Also:
Values_Match(Value, Value)

Types_Match

public boolean Types_Match(Value this_value,
                           Value that_value)
Tests if the types of two Values match.

If Specific matching is enabled, then the types must be identical to match; otherwise gneral classifications (i.e. NUMERIC,STRING, or ARRAY) will also match.

N.B.: If either Value is null the match is false.

Specified by:
Types_Match in interface Selector
Parameters:
this_value - The first of a pair of Values to be matched.
that_value - The second of a pair of Values to be matched.
Returns:
true if the Value types match; false otherwise.

Bases_Match

public boolean Bases_Match(Value this_value,
                           Value that_value)
Tests if the integer radix base values of two Values match.

When the two Values do not have INTEGER data, a match always occurs. Otherwise the radix base values are compared numerically using the Equal and/or Less_Than or Greater_Than logic of this Selection.

N.B.: If either Value is null the match is false.

Specified by:
Bases_Match in interface Selector
Parameters:
this_value - The first of a pair of Values to be matched.
that_value - The second of a pair of Values to be matched.
Returns:
true if the Value radix base values match; false otherwise.
See Also:
Equal(boolean), Less_Than(boolean), Greater_Than(boolean)

Units_Match

public boolean Units_Match(Value this_value,
                           Value that_value)
Tests if the units descriptions of two Values match.

If both Values do not have units descriptions, they match; but if one or the other does not have a units description, they do not match. If Pattern_Matching is enabled, the the units String of this_value is matched against the regular expression pattern of that_value's units String. If the regular expression syntax is invalid a normal String comparision is done. If Specific matching is enabled, then the String equals method is used; otherwise the equalsIgnoreCase method is used.

N.B.: If either Value is null the match is false.

Specified by:
Units_Match in interface Selector
Parameters:
this_value - The first of a pair of Values to be matched.
that_value - The second of a pair of Values to be matched.
Returns:
true if the Value units descriptions match; false otherwise.
See Also:
String.matches(String)

Data_Match

public boolean Data_Match(Value this_value,
                          Value that_value)
Tests if the data of two Values match.

If both Values have null data, they match; but if one or the other is null, they do not match.

If the Values are NUMERIC type the data are compared numerically using the Equal and/or Less_Than or Greater_Than logic of this Selection.

For STRING types, if Pattern_Matching is enabled the String data of this_value is matched against the regular expression pattern of that_value's String data. If the regular expression syntax is invalid a normal String comparision is done. If Specific matching is enabled, then the String equals method is used; otherwise the equalsIgnoreCase method is used.

For ARRAY types the data of all Values in the data Vector must match, using the current Selection criteria, for a match to occur. If the Data criteria applies then the match is recursive for all Array Values.

When both Values are of UNKNONW type, they match.

N.B.: If either Value is null the match is false.

Specified by:
Data_Match in interface Selector
Parameters:
this_value - The first of a pair of Values to be matched.
that_value - The second of a pair of Values to be matched.
Returns:
true if the data of the Values match; false otherwise.
See Also:
String.matches(String)

PIRL

Copyright (C) \ 2003-2009 Bradford Castalia, University of Arizona