Package net.sf.saxon.expr.instruct
Class ParameterSet
java.lang.Object
net.sf.saxon.expr.instruct.ParameterSet
A ParameterSet is a set of parameters supplied when calling a template.
It is a collection of name-value pairs.
(Use of numeric IDs dropped in 9.6 to support separate compilation of packages)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic ParameterSetstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty parameter setParameterSet(int capacity) Create a parameter set specifying the initial capacityCreate a parameter set from a name/value mapParameterSet(ParameterSet existing, int extra) Create a parameter set as a copy of an existing parameter set -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all valuesintGet the index position of a parameterGet the set of key namesgetValue(int index) Get the value of the parameter at a given indexbooleanisTypeChecked(int index) Determine whether the parameter at a given index has been type-checkedvoidIf any values are non-memo closures, expand themvoidput(StructuredQName id, Sequence value, boolean checked) Add a parameter to the ParameterSetintsize()Get the number of parameters in the parameter set
-
Field Details
-
EMPTY_PARAMETER_SET
-
NOT_SUPPLIED
public static final int NOT_SUPPLIED- See Also:
-
SUPPLIED
public static final int SUPPLIED- See Also:
-
SUPPLIED_AND_CHECKED
public static final int SUPPLIED_AND_CHECKED- See Also:
-
-
Constructor Details
-
ParameterSet
public ParameterSet()Create an empty parameter set -
ParameterSet
public ParameterSet(int capacity) Create a parameter set specifying the initial capacity- Parameters:
capacity- the nominal number of entries in the parameter set
-
ParameterSet
Create a parameter set from a name/value map- Parameters:
map- the supplied map
-
ParameterSet
Create a parameter set as a copy of an existing parameter set- Parameters:
existing- the parameter set to be copiedextra- the space to be allocated for additional entries
-
-
Method Details
-
size
public int size()Get the number of parameters in the parameter set- Returns:
- the number of parameters
-
put
Add a parameter to the ParameterSet- Parameters:
id- The parameter id, representing its name.value- The value of the parameterchecked- True if the caller has done static type checking against the required type
-
getParameterNames
Get the set of key names- Returns:
- the key names
-
getIndex
Get the index position of a parameter- Parameters:
id- The numeric parameter id, representing its name.- Returns:
- The index position of the parameter, or -1 if not defined
-
getValue
Get the value of the parameter at a given index- Parameters:
index- the position of the entry required- Returns:
- the value of the parameter at that position
-
isTypeChecked
public boolean isTypeChecked(int index) Determine whether the parameter at a given index has been type-checked- Parameters:
index- the position of the entry required- Returns:
- true if the parameter at that position has been type-checked
-
clear
public void clear()Clear all values -
materializeValues
If any values are non-memo closures, expand them- Throws:
XPathException- if an error occurs evaluating any closures
-