|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.tree.DefaultMutableTreeNode PIRL.PVL.Parameter
public class Parameter
A Parameter is a general-purpose named entity containing an arbitrary value. It is derived from the Parameter Value Language syntax:
Name = Value
Every Parameter has a Name which is a String of zero or more characters.
The kind of Value that a Parameter contains is indicated by its Classification code. There are three basic classifications:
TOKEN
ASSIGNMENT
AGGREGATE
GROUP
or OBJECT
specific classification; a distinction without a difference for
this package (but which may be useful to the application).
There is also an UNKNOWN
classification for a
completely vacant Parameter (though its name is the empty string,
not null). In addition, END
classification Parameters
may be used to mark the end of an aggregate's Parameter List without
removing the Parameters beyond the end marker.
A Parameter may have Comments associated with it that contain any descriptive text.
Value
,
Parser
,
Serialized FormField Summary | |
---|---|
static int |
AGGREGATE
Non-specific classification for a Parameter associated with an aggregate list. |
static int |
ASSIGNMENT
Classification for a Parameter with a Value. |
static int |
BEGIN_GROUP
Alias for GROUP . |
static int |
BEGIN_OBJECT
Alias for OBJECT . |
static int |
END
Used to mark the end of an aggregate Parameter's List. |
static int |
END_AGGREGATE
Special classification for the end of an aggregate Parameter List. |
static int |
END_GROUP
A specific form of END_AGGREGATE . |
static int |
END_OBJECT
A specific form of END_AGGREGATE . |
static int |
END_PVL
A special classification that marks the end of all Parameters. |
static int |
GROUP
Classification for a Parameter that contains a List of Parameters. |
static int |
HIGHEST_BIT
The highest bit used by the classification code bit field. |
static String |
ID
Class name and version identification. |
static int |
LOWEST_BIT
The lowest bit used by the classification code bit field. |
static int |
MASK
Selects only the classification code bit fields recognized by the Parameter class. |
static int |
OBJECT
Classification for an aggregate Parameter; and is functionally identical to the GROUP classification. |
static int |
TOKEN
Classification for a Parameter with only a name. |
static int |
UNKNOWN
The classification of an empty Parameter. |
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
---|---|
Parameter()
Creates an empty Parameter, with classification UNKNOWN
and an empty string name (not null). |
|
Parameter(Parameter parameter)
A Parameter is constructed from a copy of another Parameter. |
|
Parameter(Parser parser)
Create a Parameter by getting all Parameters from a Parser. |
|
Parameter(String name)
Creates a token Parameter with only a name. |
|
Parameter(String name,
Parser parser)
A Parser is used to get a new Parameter which is given the specified name. |
Method Summary | |
---|---|
static String |
Absolute_Pathname(String pathname)
Produce an absolute pathname. |
static String |
Absolute_Pathname(String parent_path,
String base_path)
Combines two pathnames to produce an absolute pathname. |
Parameter |
Add(List list)
Adds a List of Parameters to the end of the aggregate list. |
void |
add(MutableTreeNode parameter)
Invokes the Parameter's Add method. |
Parameter |
Add(Parameter parameter)
Adds a Parameter to the end of the aggregate list. |
Parameter |
Add(Parser parser)
Adds the Parameters obtained from a Parser to this Parameter's aggregate list. |
protected void |
adopt(Vector list)
Sets the parents of a Vector of Parameters to this Parameter. |
static String |
Basename(String pathname)
Gets the basename portion of the pathname. |
String |
Classification_Name()
Gets the name String associated with the Parameter's classification. |
static String |
Classification_Name(int class_code)
Gets the name String associated with the classification code. |
int |
Classification()
Gets the Parameter's classification code. |
Parameter |
Classification(int class_code)
Sets the classification of the Parameter. |
static int |
Classification(Object object)
Determine the general classification of an Object. |
Object |
clone()
Makes a deep copy of the Parameter. |
String |
Comments()
Gets the comments String. |
Parameter |
Comments(String comments)
Sets the comments String. |
Object |
Data()
Get the Parameter's data object. |
Parameter |
Data(Object data)
Sets the data for the Parameter. |
Parameter |
Data(Parameter parameter)
Copies the contents of a Parameter into this Parameter. |
String |
Description()
Gets a PVL description of the Parameter. |
String |
Description(Lister lister)
Gets a PVL description of the Parameter using a specified Lister. |
boolean |
equals(Object object)
Tests if an Object is equal to this Parameter. |
boolean |
equalsIgnoreCase(Parameter parameter)
Tests if a Parameter is equivalent to this Parameter, ignoring certain cases where field values are not equal. |
Parameter |
Find(int classification)
Finds the Parameter having the specified classification. |
Parameter |
Find(int classification,
Parameter last_parameter)
Finds the Parameter having the specified classification, beginning after the specified Parameter object within the aggregate. |
Parameter |
Find(Parameter test_parameter)
Finds the Parameter that completely matches a test Parameter. |
Parameter |
Find(Parameter test_parameter,
Parameter last_parameter)
Finds the Parameter that completely matches a test Parameter, beginning after the specified Parameter object within the aggregate. |
Parameter |
Find(Parameter test_parameter,
Selector criteria)
Finds the Parameter that matches a test Parameter according the Selector criteria. |
Parameter |
Find(Parameter test_parameter,
Selector criteria,
Parameter last_parameter)
Searches for a Parameter that matches a test Parameter according the Selector criteria, optionally after some specific Parameter object has been located first. |
Parameter |
Find(String name)
Finds the Parameter with the specified name, which may be a simple name or a pathname. |
Parameter |
Find(String name,
boolean case_sensitive)
Finds the Parameter with the specified name, which may be a simple name or a pathname. |
Parameter |
Find(String name,
boolean case_sensitive,
Parameter last_parameter)
Finds the Parameter with the specified name, which may be a simple name or a pathname, beginning after the specified Parameter object within the aggregate. |
Parameter |
Find(String name,
int classification)
Finds the Parameter having the specified pathname and classification. |
Parameter |
Find(String name,
int classification,
Parameter last_parameter)
Finds the Parameter having the specified pathname and classification, beginning after the specified Parameter object within the aggregate. |
Parameter |
Find(String name,
Parameter last_parameter)
Finds the Parameter with the specified name, which may be a simple name or a pathname, beginning after the specified Parameter object within the aggregate. |
PVL_Exception |
First_Warning()
Returns the first warning since the last Reset_Warning . |
Parameter |
First_Warning(boolean first)
Enables or disables returning the first warning that occurs as the current warning status. |
protected void |
graft(Parameter parameter)
Grafts the contents of a Parameter into this Parameter. |
boolean |
Has_List()
Tests if the Parameter has an aggregate list. |
boolean |
Has_Value()
Tests if the Parameter has a valid Value assigment. |
Parameter |
Insert(List list,
int index)
Inserts a List of Parameters into the aggregate list starting at the specified index. |
void |
insert(MutableTreeNode parameter,
int index)
Invokes the Parameter's Insert method. |
Parameter |
Insert(Parameter parameter,
int index)
Inserts a Parameter into the aggregate list at the specified index. |
static boolean |
Is_Absolute_Pathname(String pathname)
Test if a pathname is absolute. |
boolean |
Is_Aggregate()
Tests if the Parameter is classified as an aggregate. |
static boolean |
Is_Aggregate(int class_code)
Tests for an aggregate classification. |
boolean |
Is_Assignment()
Tests if the Parameter is classified as an assignment. |
static boolean |
Is_Assignment(int class_code)
Tests for the assignment classification. |
boolean |
Is_Begin_Aggregate()
Tests if the Parameter is classified as an aggregate beginning. |
static boolean |
Is_Begin_Aggregate(int class_code)
Tests for an aggregate beginning classification. |
boolean |
Is_Begin_Group()
Tests if the Parameter is classified as beginning a group aggregate. |
static boolean |
Is_Begin_Group(int class_code)
Tests for the begin group aggregate classification. |
boolean |
Is_Begin_Object()
Tests if the Parameter is classified as beginning an object aggregate. |
static boolean |
Is_Begin_Object(int class_code)
Tests fpr the begin object aggregate classification. |
boolean |
Is_Empty()
Determines if the Parameter list is empty. |
boolean |
Is_End_Aggregate()
Tests if the Parameter is classified as an aggregate ending. |
static boolean |
Is_End_Aggregate(int class_code)
Tests for an aggregate ending classification. |
boolean |
Is_End_Group()
Tests if the Parameter is classified as ending a group aggregate list. |
static boolean |
Is_End_Group(int class_code)
Tests for the end group aggregate list classification. |
boolean |
Is_End_Object()
Tests if the Parameter is classified as ending an object aggregate list. |
static boolean |
Is_End_Object(int class_code)
Tests for the end object aggregate list classification. |
boolean |
Is_End_PVL()
Tests if the Parameter is the END_PVL classification. |
static boolean |
Is_End_PVL(int class_code)
Tests for the END_PVL classification. |
boolean |
Is_End()
Tests if the Parameter is one of the END classifications. |
static boolean |
Is_End(int class_code)
Tests for an END classification. |
boolean |
Is_Group()
Tests if the Parameter is classified as a group aggregate. |
static boolean |
Is_Group(int class_code)
Tests for the group aggregate classification. |
boolean |
Is_Object()
Tests if the Parameter is classified as an object aggregate. |
static boolean |
Is_Object(int class_code)
Tests for the object aggregate classification. |
static boolean |
Is_Parameter_List(Object object)
Tests if an Object is a List (Vector) suitable for an aggregate Parameter. |
static boolean |
Is_Parameter_Value(Object object)
Tests if an Object is a Value suitable for a Parameter. |
static boolean |
Is_Parameter(Object object)
Tests if an Object is a Parameter. |
boolean |
Is_Token()
Tests if the Parameter is classified as a token. |
static boolean |
Is_Token(int class_code)
Tests for the token classification. |
boolean |
Is_Unknown()
Tests if the Parameter is classified as UNKNOWN
(an empty Parameter). |
static boolean |
Is_Unknown(int class_code)
Tests for the UNKNOWN classification. |
Iterator |
iterator()
Provides an Iterator starting at the first element of the list. |
Iterator |
iterator(int index)
Provides an Iterator for the aggregate list positioned so that the next element returned will be at the specified index of the list. |
PVL_Exception |
Last_Warning()
Returns the last warning since a Reset_Warning . |
Parameter |
Last_Warning(boolean last)
Enables or disables returning the last warning that occurs as the current warning status. |
int |
List_Size()
Gets the size of an aggregate's list; the number of Parameters it contains. |
Vector |
List()
Gets the Parameter list aggregated under this Parameter. |
Parameter |
List(Vector list)
Sets the Parameter list for the Parameter. |
ListIterator |
listIterator()
Provides a ListIterator starting at the first element of the list. |
ListIterator |
listIterator(int index)
Provides a ListIterator for the aggregate list positioned so that the next element returned will be at the specified index of the list. |
boolean |
Match_Depth(Parameter parameter,
Selector criteria)
Tests if a Parameter matches this Parameter using the specified criteria. |
boolean |
Match(Parameter parameter,
Selector criteria)
Tests if a Parameter matches this Parameter using the specified criteria. |
String |
Name()
Gets the name of the Parameter. |
Parameter |
Name(String name)
Sets the Parameter's name. |
protected static void |
orphan(List list)
Sets a list of Parameters to have no parent. |
static String |
Parent_Pathname(String pathname)
Gets the portion of a pathname to the parent parameter. |
Parameter |
Parent()
Gets the Parameter that is this Parameter's parent. |
static char |
Path_Delimiter()
Gets the current Path_Name delimiter. |
static char |
Path_Delimiter(char delimiter)
Sets the Path_Name delimiter. |
String |
Path_from(Parameter root_parent)
Gets the pathname of the Parameter from some parent Parameter. |
String |
Path_Name()
Gets the fully qualified pathname of the Parameter. |
String |
Path_to_Name()
Gets the pathname of the Parameter without the Parameter's name. |
Parameter |
Remove_All()
Empties the Parameter aggregate list. |
void |
remove(int index)
Invokes the Parameter's Remove method. |
Parameter |
Remove(int index)
Removes the Parameter at the specified index from the aggregate list. |
void |
remove(MutableTreeNode parameter)
Invokes the Parameter's Remove method. |
Parameter |
Remove(Parameter parameter)
Removes the specified Parameter from the aggregate list. |
Parameter |
Reset_Warning()
Clears any warning status so that the Warning method
will return null until the next warning condition occurs. |
protected void |
set_classification(int class_code)
Sets the appropriate classification variables. |
protected void |
set_data(Object data)
Set the appropriate Data variables. |
void |
setAllowsChildren(boolean allows)
Overrides the base class method to ensure Parameter integrity. |
void |
setUserObject(Object object)
Overrides the base class method to ensure Parameter integrity. |
String |
toString()
Gets the name of the Parameter. |
Value |
Value()
Gets the Value assigned to the Parameter. |
Parameter |
Value(byte value)
Assigns a new Value constructed from a primitive byte value. |
Parameter |
Value(double value)
Assigns a new Value constructed from a primitive double value. |
Parameter |
Value(float value)
Assigns a new Value constructed from a primitive float value. |
Parameter |
Value(int value)
Assigns a new Value constructed from a primitive int value. |
Parameter |
Value(long value)
Assigns a new Value constructed from a primitive long value. |
Parameter |
Value(Object value)
Assigns a new Value constructed from an Object. |
Parameter |
Value(short value)
Assigns a new Value constructed from a primitive short value. |
Parameter |
Value(Value value)
Sets the Value for the Parameter. |
PVL_Exception |
Warning()
Gets the current warning status. |
int |
Write()
Writes the Parameter in PVL syntax to System.out
starting at level 0, not strict. |
int |
Write(boolean indent)
Writes the Parameter in PVL syntax to System.out
with or without indenting, not strict. |
int |
Write(boolean indent,
boolean strict)
Writes the Parameter in PVL syntax to output System.out
with indenting and strict PVL enabled or disabled. |
int |
Write(Lister lister)
Writes the Parameter in PVL syntax using a PVL Lister. |
int |
Write(OutputStream output)
Writes the Parameter in PVL syntax to the output starting at level 0, not strict. |
int |
Write(OutputStream output,
boolean indent)
Writes the Parameter in PVL syntax to the output with or without indenting, not strict. |
int |
Write(OutputStream output,
boolean indent,
boolean strict)
Writes the Parameter in PVL syntax to the output with indenting and strict PVL enabled or disabled. |
int |
Write(OutputStream output,
int level,
boolean strict)
Writes the Parameter in PVL syntax to an OutputStream. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ID
public static final int LOWEST_BIT
public static final int HIGHEST_BIT
public static final int TOKEN
public static final int ASSIGNMENT
public static final int AGGREGATE
This classification is a place-holder for all Parameters associated with a Parameter aggregate list. If it is used with the Classification method, the default GROUP classification will be applied.
GROUP
,
Constant Field Valuespublic static final int END
Do not set the classification of a Parameter to this value, but logically OR it with a specific classification. For example, to temporarily mark a Parameter as the end of an aggregate:
Parameter parameter = aggregate.Find ("Parameter_Name"); if (parameter != null) { // Mark the end of the list here. parameter.Classification (parameter.Classifcation () | END); // The list stops with the parameter before "Parameter_Name". parameter.Parent ().Write (); // Restore the previous classification. parameter.Classification (parameter.Classifcation () & ~END); }
Using the END_AGGREGATE
classification may be easier.
END_AGGREGATE
,
END_PVL
,
Constant Field Valuespublic static final int END_PVL
An END_PVL
Parameter will truncate any remaining
Parameters in the current List and the Lists of any Parent
Parameters. However, the truncated Parameters remain in place and
can be restored by restoring the classification of the marked
Parameter.
END
,
END_AGGREGATE
,
Constant Field Valuespublic static final int END_AGGREGATE
The END_GROUP
and END_OBJECT
are specific
versions of this classification.
Note that while a Parameter classified as an END_XXX
Parameter may be used, they are not required (and typically not
used) except in the PVL syntax seen by the Parser. The appropriate
END_XXX
Parameter is implicit, and will be provided
automatically by the Write method, at the end of each aggregate. An
END_XXX
Parameter in a Parameter List will
functionally truncate the List at that point; the additional
Parameters of the List remain and can be functionally recovered by
restoring the original classification. For example,
Parameter parameter = aggregate.Find ("Parameter_Name"); if (parameter != null) { // Save the current classification. int classification = parameter.Classification (); // Mark the end of the list here. parameter.Classification (Parameter.END_AGGREGATE); // The list stops with the parameter before "Parameter_Name". parameter.Parent ().Write (); // Restore the previous classification. parameter.Classification (classification); }
END
,
END_PVL
,
Constant Field Valuespublic static final int GROUP
This Parameter has no Value, but instead contains a List (Vector)
of children Parameters. This classification is functionally
identical to OBJECT
. The distinction is based on the
PVL keyword syntax recognized by the Parser when an aggregate
Parameter is constructed.
Parser
,
Constant Field Valuespublic static final int BEGIN_GROUP
GROUP
.
GROUP
,
Constant Field Valuespublic static final int END_GROUP
END_AGGREGATE
.
END_AGGREGATE
,
Constant Field Valuespublic static final int OBJECT
GROUP
classification.
Don't confuse this classification with the Java Object class. The name is a formal keyword in the PVL syntax.
GROUP
,
Constant Field Valuespublic static final int BEGIN_OBJECT
OBJECT
.
OBJECT
,
Constant Field Valuespublic static final int END_OBJECT
END_AGGREGATE
.
END_AGGREGATE
,
Constant Field Valuespublic static final int UNKNOWN
public static final int MASK
Logical AND with another int variable will ensure that only Parameter classification bits remain.
Constructor Detail |
---|
public Parameter()
UNKNOWN
and an empty string name (not null).
public Parameter(String name)
name
- The name of this token. If null, the name will
be set to the empty String.public Parameter(Parser parser) throws PVL_Exception
When the source for the Parser is a String, and the String's PVL
defines more than one Parameter (excluding any Parameters that may
be contained within aggregate Parameters), then an aggregate
Parameter will be provided to contain all of the Parameters, and
will be given the name
. However, if the String only
defines a single, top-level Parameter, then that is what will be
provided.
Parser.CONTAINER_NAME
When the source for the Parser is not a String, then a container Parameter will always be used to hold the results from the Parser, regardless of the number of Parameters that are defined.
parser
- The Parser source for PVL syntax.
PVL_Exception
- When the Parser encounters an
unrecoverable error. The Parser may also generate a
Warning which will associated with the new Parameter.Parser
public Parameter(String name, Parser parser) throws PVL_Exception
This constructor is typically used when the source for the Parser
is a File and the resultant aggregate Parameter is to be given the
name of the File, rather than the default
. Note
that if the Parser source is a String that defines a single
Parameter, then the name of that Parameter will be overriden by the
new name from this constructor.
Parser.CONTAINER_NAME
parser
- The Parser source for PVL syntax. If null this
is the same as using the no argument constructor.name
- The name of the new Parameter. If null, the name will
be set to the empty String.
PVL_Exception
- When the Parser encounters an
unrecoverable error. The Parser may also generate a
Warning which will be associated with the new Parameter.Parser
public Parameter(Parameter parameter) throws PVL_Exception
The contents of the original Parameter are copied into the new Parameter. The warning status from the original is not copied.
When the original Parameter is an assignment, the Value is completely copied.
When the original is an aggregate, a new Parameter list is created
in which each element is a recursive copy of the elements from the
original list in the same order. Note: List copying stops at
END_AGGREGATE parameters, and all copying stops at END_PVL
parameters; the new Parameter is a logical copy of the original.
Thus the new Parameter will be equivalent (
) to the original, but may not be
identical (equalsIgnoreCase
).
equals
parameter
- The original Parameter to be copied. If null this
is the same as using the no argument constructor.
PVL_Exception
- set_classification(int)
,
()
,
Add(Parameter)
,
Value.Value(Value)
Method Detail |
---|
public String Name()
public Parameter Name(String name)
name
- The name String. If null the name will be set
to the empty String.
public String toString()
toString
in class DefaultMutableTreeNode
public String Path_Name()
The pathname is the name of the Parameter preceeded by the current
character. If
this Parameter has a Path_Delimiter
then the
delimiter is preceeded by the parent's pathname. This recursion
produces a pathname that starts with the delimiter character
followed by the name of the root Parameter (no parent), the names
of all containing aggregate Parameters leading to this Parameter
separated by the delimiter, and ending with the name of this
Parameter. If this Parameter has no parent, then the pathname is
just its name preceeded by the delimiter.
Parent
Path_Delimiter()
,
Parent()
public String Path_to_Name()
The trailing
character is included. If this Parameter has no parent, then only
the delimiter will be returned.
Path_Delimiter
Path_Name()
public String Path_from(Parameter root_parent)
The pathname includes the names of each Parameter from, but not
including, the root_parent up to, and including, this Parameter.
The pathname will begin with the
character and each Parameter name will
be separated from the next by the same delimiter.
Path_Delimiter
Note: The pathname returned by this method is the absolute
pathname for the Parameter in the root_parent, as used by the
Find
method.
root_parent
- A Parent of this Parameter.
public static char Path_Delimiter()
The default delimiter is the slash ('/') character.
public static char Path_Delimiter(char delimiter)
Note: The delimiter is a static class variable that applies to all Parameters.
delimiter
- The delimiter char.
public static String Absolute_Pathname(String parent_path, String base_path)
The base_path is taken to be relative to the parent_path. Typically
the base_path is a simple name (e.g. a Basename
),
and the parent_path is a path from the root (e.g. a Parent_Pathname
). However, any pathnames
will do. If the parent_path is not absolute
it is made absolute. The
base_path, if not null or empty, is appended to the parent_path with
a single separating delimiter.
parent_path
- The pathname of the parent parameter. If null or
empty, the root pathname is used.base_path
- The pathname of the parameter relative to the
parent_path.
public static String Absolute_Pathname(String pathname)
The specified pathname is converted, if needed, to a top level absolute pathname.
pathname
- The pathname of a parameter.
public static boolean Is_Absolute_Pathname(String pathname)
An absolute pathname begins with the current ()
path delimiter
.
pathname
- The pathname of a parameter.
public static String Parent_Pathname(String pathname)
The parent pathname is the substring of the pathname preceding the
last path delimiter
(usually the
'/' character). If there is no delimiter in the pathname, or
nothing preceding the last delimiter, then there is no parent
pathname.
N.B.: This function only considers the specified pathname.
It does not provide the name of a Parameter's parent
.
pathname
- The String naming a pathname to a parameter.
public static String Basename(String pathname)
The basename is the substring of the pathname following the last
path delimiter
(usually the '/'
character). If the pathname does not contain a delimiter, then the
entire pathname is the basename.
pathname
- The String naming a pathname to a parameter.
public String Description(Lister lister)
If no Lister is specified (the argument is null) then a default Lister will be provided.
The Lister will have its Writer set
to a StringWriter used to write the PVL syntax. The Parameter is
Write
n using the Lister and the
resultant String, without any final end-of-line sequence, is
returned. If the Write method produces an exception, the exception
message is returned after a Lister.NEW_LINE
(this should be a
unique flag that producing the PVL description failed).
lister
- The Lister to use when writing the PVL syntax.
public String Description()
The Parameter is Write
n to a
StringWriter on a default Lister and the resultant String is
returned. If the Write method produces an exception, the exception
message is returned.
Description(Lister)
public Value Value() throws PVL_Exception
PVL_Exception
- public Vector List() throws PVL_Exception
PVL_Exception.ILLEGAL_SYNTAX
warning status is set.
PVL_Exception
- public boolean Is_Empty()
Vector.isEmpty()
public Object Data()
public Parameter Value(Value value)
The Parameter is classified as an assignment and the specified Value is assigned. If the Parameter previously had data, it is replaced. In the case where previous data was an aggregate Parameter list, all elements of the list are orphaned (they are marked as having no parent). Note: The Value is not copied.
value
- The Value object to be assigned.
set_classification(int)
,
set_data(Object)
public Parameter Value(byte value) throws PVL_Exception
value
- The primitive datum for the new Value.
PVL_Exception
- If a new Value could not be constructed from
the value.Value(Value)
public Parameter Value(short value) throws PVL_Exception
value
- The primitive datum for the new Value.
PVL_Exception
- If a new Value could not be constructed from
the value.Value(Value)
public Parameter Value(int value) throws PVL_Exception
value
- The primitive datum for the new Value.
PVL_Exception
- If a new Value could not be constructed from
the value.Value(Value)
public Parameter Value(long value) throws PVL_Exception
value
- The primitive datum for the new Value.
PVL_Exception
- If a new Value could not be constructed from
the value.Value(Value)
public Parameter Value(float value) throws PVL_Exception
value
- The primitive datum for the new Value.
PVL_Exception
- If a new Value could not be constructed from
the value.Value(Value)
public Parameter Value(double value) throws PVL_Exception
value
- The primitive datum for the new Value.
PVL_Exception
- If a new Value could not be constructed from
the value.Value(Value)
public Parameter Value(Object value) throws PVL_Exception
value
- The Object from which to construct the new Value.
PVL_Exception
- If a new Value could not be constructed from
the value.Value(Value)
public Parameter List(Vector list) throws PVL_Exception
The Parameter is classified as an AGGREGATE
(i.e.
GROUP
) and the contents of the Vector are adopted. The
new list must contain only Parameter elements, each of which has
its parent set to this Parameter. If the Parameter previously had
data, it is replaced. In the case where previous data was an
aggregate Parameter list, all elements of the list are orphaned
(they are marked as having no parent). Note: The list is not
copied.
list
- The Vector of Parameters to be adopted.
PVL_Exception
- From set_data.set_classification(int)
,
set_data(Object)
public int List_Size()
public Parameter Data(Parameter parameter) throws PVL_Exception
This Parameter is made equivalent (
not
necessarily equalsIgnoreCase
) to the
specified Parameter.
equals
parameter
- The Parameter to be copied into this Parameter.
If null, and empty parameter will be used.
PVL_Exception
- From graft.Parameter(Parameter)
,
graft(Parameter)
public Parameter Data(Object data) throws PVL_Exception
If the data is a Parameter object then its contents are copied into
this Parameter; i.e. this Parameter is made equivalent (
not
necessarily equalsIgnoreCase
) to the
specified Parameter. Otherwise the Parameter is classified based on
the equals
of the data
Object specified. The classification will be an
Classification
ASSIGNMENT
if the data is a Value, an
AGGREGATE
(i.e. GROUP
) for Parameter list
data, or a TOKEN
if the data is null (unless the
Parameter has no name, in which case the classification is
UNKNOWN
). The data is applied to the Parameter
appropriately as if either the
or Value
(Value)
method were used.
List (Vector)
data
- The data Object to be applied.
PVL_Exception
- From set_data.Data(Parameter)
,
Classification(Object)
,
set_classification(int)
,
set_data(Object)
,
Value(Value)
,
List(Vector)
public Parameter Insert(Parameter parameter, int index) throws PVL_Exception
If the Parameter is not already classified as an aggregate, and
does not have a Value assigned, it is given the GROUP
classification. The specified Parameter is inserted at the
specified index in the aggregate Parameter list. Any Parameters in
the list at, or beyond the index are moved to the next index.
After the specified Parameter is inserted its parent is set to this Parameter.
Warning: Inserted parameters are not removed from any Aggregate list they may already be in.
parameter
- The Parameter object to be inserted.index
- The location in the list for the insertion.
PVL_Exception
- ILLEGAL_SYNTAX
Classification(int)
,
Remove(Parameter)
,
Vector.insertElementAt(Object, int)
public Parameter Insert(List list, int index) throws PVL_Exception
The elements of the List are Insert
ed in the order
they occur from the List's listIterator at sequential locations
starting with the specified index.
list
- The List of Parameters to Insert.index
- The first of sequential Insert locations.
PVL_Exception
- BAD_ARGUMENT
Insert(Parameter, int)
,
List.listIterator()
public Parameter Add(Parameter parameter) throws PVL_Exception
Uses the Insert
method where the index is the end of
the list.
parameter
- The Parameter to be added.
PVL_Exception
- From Insert.Insert(Parameter, int)
public Parameter Add(List list) throws PVL_Exception
Performs an Insert
where the
index is the end of the list.
list
- The List of Parameters to be added.
PVL_Exception
- From Insert.Insert(List, int)
public Parameter Add(Parser parser) throws PVL_Exception
parser
- The Parser to use as the source of PVL statements.
PVL_Exception
- From the Parser.
Note: The warning status for the Parser is cleared before
it is called, and then applied to this Parameter afterwards.Parser.Add_To(Parameter)
,
Parser.Warning()
public Parameter Remove(int index)
After being removed from the aggregate list the Parameter is marked as having no parent.
index
- The aggregate list index of the Parameter to be removed.
PVL_Exception.ILLEGAL_SYNTAX
Warning status is
set.Vector.remove(int)
public Parameter Remove(Parameter parameter)
The first occurance of the Parameter in the list is removed. The
aggregate list, if there is one, is searched regardless of the
classification of this Parameter. Only this Parameter list is
searched, not the lists of any aggregate Parameters in the list.
The Parameter is found in the aggregate list by equality of
Parameter object reference, not by the equals
method.
To remove a Parameter that equals another Parameter, use
Find
:
// Use Path_from only if the specific location matters. parameter = aggregate.Find (parameter.Name (parameter.Path_from (aggregate))); if (parameter != null) parameter.Parent ().Remove (parameter);
parameter
- The Parameter object to be removed. If null
nothing is done and null is returned.
ILLEGAL_SYNTAX
Warning status is produced.Remove(int)
public Parameter Remove_All()
The aggregate list, if it exists, is removed regardless of the classification of this Parameter. All Parameters in the list (but not sub-lists) are marked as not having a parent.
protected void set_data(Object data) throws PVL_Exception
The Classification
of the data object determines how
the internal data variables are set. Consistency of the Parameter's
data is ensured by always setting it with this method.
For Vector data, the data becomes the base class aggregate list (children) Vector. Its contents are adopted which confirms that each element is a Parameter and its parent is set to this Parameter. This Parameter's Value is set to null.
For Value data, the data becomes the Value of the Parameter. The aggregate list (children) contents are orphaned and then the children Vector is set to null.
>>> WARNING <<< The classification of the Parameter is not updated. Accordingly, this method should only be used by methods that will also set the classification appropriately.
data
- The Object to become the Parameter's data.
PVL_Exception
- BAD_ARGUMENT
Classification(Object)
,
adopt(Vector)
,
orphan(List)
protected void graft(Parameter parameter) throws PVL_Exception
In effect, this Parameter becomes the specified Parameter.
The Value reference is set (not copied) to the specified Parameter's Value reference along with the name, comments, and warning status. The aggregate list (children) Vector reference is set to the specified Parameter's Vector and if it has contents they are adopted by this Parameter (the specified Parameter's children Vector is set to null to avoid any possible confusion). The classification is set to be the same as the specified Parameter. Note: The parent of this Parameter remains unchanged; i.e. the contents of are replaced but the context stays the same.
parameter
- The Parameter object to graft into this Parameter.
If null, nothing is done.
PVL_Exception
- From adopt.adopt(Vector)
,
set_classification(int)
protected void adopt(Vector list) throws PVL_Exception
>>> WARNING <<< Only the parent references for the Parameters in the Vector are set to this Parameter. The Vector itself may still be referenced by some other Parameter. In this case the adoption of the Vector will not be complete until the reference in the former parent is changed (e.g. to null).
list
- The Vector of Parameters to adopt.
PVL_Exception
- BAD_ARGUMENT
protected static void orphan(List list)
>>> WARNING <<< Only the parent references for the Parameters in the list are set to null. The list itself may still be referenced by some other Parameter. In this case the orphaning of the Vector will not be complete until the reference in the former parent is changed (e.g. to null).
list
- The List of Parameters to orphan.public int Classification()
public static int Classification(Object object)
The Object is considered to be potential Parameter data and is tested to see if it is an instance of an acceptable Java Class for Parameter data. Note that only a general classification can be determined by examining an Object.
object
- The Object to be tested.
ASSIGNMENT
classification is returned; if a Vector, then the
AGGREGATE
code is returned; and if the argument is
null then the UNKNOWN
classification is returned.
If an invalid object is specified, then the return value is -1.public Parameter Classification(int class_code)
Note: Changing to a new classification may result in loss of
data if the Parameter's previous data is invalid under the new
classification. If the new classification is not for assignment,
then any Value is dropped; if the new classification is not for an
aggregate, then any existing list is removed. However,
END_XXX
classifications are exempt:
END_XXX
classification Parameters are normally
implicit at the end of aggregate Parameter lists. They are used
explicitly to mark, probably temporarily, the end of a list or an
entire hierarchy (END_PVL
). Therefore, when these
classifications are applied to a Parameter its underlying data is
left intact.
class_code
- The new Parameter classification int.
END_AGGREGATE
,
END_PVL
,
set_classification(int)
,
Remove_All()
protected void set_classification(int class_code)
Consistency of the Parameter's classification is ensured by always
setting it with this method. If the classification code is for an
AGGREGATE
, then the allowsChildren variable of the
DefaultMutableTreeNode base class will be set to true; otherwise
it will be set to false.
>>> WARNING <<< The data of the Parameter is not checked for consistency with the classification. Accordingly, this method should only be used by methods that will also set the data appropriately.
class_code
- The int classification code for the Parameter.public static String Classification_Name(int class_code)
Classification names are identical to the names of the
classification code constants, except that the
BEGIN_XXX
aliases are not used.
class_code
- The classification code int.
public String Classification_Name()
public static boolean Is_Parameter(Object object)
object
- The Object to be tested.
public static boolean Is_Parameter_Value(Object object)
object
- The Object to be tested.
Value.Is_Value(Object)
public static boolean Is_Parameter_List(Object object)
Note: The contents of the list are recursively checked to all be Parameters. Aggregates without lists are acceptable Parameters.
object
- The Object to be tested.
Is_Parameter(Object)
,
Is_Begin_Aggregate()
public boolean Is_Token()
TOKEN
public boolean Is_End()
END
classifications.
END
classifcations include both the end of aggregates
(
and END_GROUP
) and the end the entire hierarchy (END_OBJECT
)
END_PVL
END
classification.END
public boolean Is_End_PVL()
END_PVL
classification.
END_PVL
classification.END_PVL
public boolean Is_Assignment()
An assignment Parameter does not necessarily have a Value (it may be null).
ASSIGNMENT
public boolean Has_Value()
Is_Assignment()
public boolean Is_Aggregate()
An aggregate Parameter does not necessarily have a aggregate list
(it may be null). Aggregate classifications include
(and its alias GROUP
BEGIN_GROUP
),
(and its alias OBJECT
BEGIN_OBJECT
),
and the END_GROUP
and END_OBJECT
forms.
AGGREGATE
public boolean Has_List()
The contents of the list are not checked (use
to check
the list contents).
Is_Parameter_List
Is_Aggregate()
public boolean Is_Begin_Aggregate()
An aggregate beginning is the Parameter that contains a list of
Parameters (the aggregate list, which may be empty or null); i.e.
it "begins" an aggregate list. Begin aggregate classifications include
(and its alias GROUP
BEGIN_GROUP
) and
(and its alias OBJECT
BEGIN_OBJECT
).
AGGREGATE
public boolean Is_End_Aggregate()
An aggregate ending is the Parameter that ends a list of
Parameters (the aggregate list). End aggregate classifications include
and
END_GROUP
.
END_OBJECT
END_AGGREGATE
public boolean Is_Object()
The
classification is
identical to the OBJECT
classification.
BEGIN_OBJECT
public boolean Is_Begin_Object()
The
classification
is identical to the BEGIN_OBJECT
classification.
OBJECT
public boolean Is_End_Object()
Is_End_Aggregate()
public boolean Is_Group()
The
classification is
identical to the GROUP
classification.
BEGIN_GROUP
public boolean Is_Begin_Group()
The
classification
is identical to the BEGIN_GROUP
classification.
GROUP
public boolean Is_End_Group()
Is_End_Aggregate()
public boolean Is_Unknown()
UNKNOWN
(an empty Parameter).
UNKNOWN
classification.UNKNOWN
public static boolean Is_Token(int class_code)
class_code
- The classification code int.
TOKEN
public static boolean Is_End(int class_code)
END
classification.
class_code
- The classification code int.
END
classification.Is_End()
,
END_AGGREGATE
,
END_PVL
public static boolean Is_End_PVL(int class_code)
END_PVL
classification.
class_code
- The classification code int.
END_PVL
classification.END_PVL
public static boolean Is_Assignment(int class_code)
class_code
- The classification code int.
ASSIGNMENT
public static boolean Is_Aggregate(int class_code)
class_code
- The classification code int.
Is_Aggregate()
public static boolean Is_Begin_Aggregate(int class_code)
class_code
- The classification code int.
Is_Begin_Aggregate()
public static boolean Is_End_Aggregate(int class_code)
class_code
- The classification code int.
Is_End_Aggregate()
,
END_AGGREGATE
public static boolean Is_Object(int class_code)
class_code
- The classification code int.
Is_Object()
public static boolean Is_Begin_Object(int class_code)
class_code
- The classification code int.
Is_Begin_Object()
public static boolean Is_End_Object(int class_code)
class_code
- The classification code int.
Is_End_Object()
public static boolean Is_Group(int class_code)
class_code
- The classification code int.
Is_Group()
public static boolean Is_Begin_Group(int class_code)
class_code
- The classification code int.
Is_Begin_Group()
public static boolean Is_End_Group(int class_code)
class_code
- The classification code int.
Is_End_Group()
public static boolean Is_Unknown(int class_code)
UNKNOWN
classification.
class_code
- The classification code int.
UNKNOWN
classification.UNKNOWN
public String Comments()
public Parameter Comments(String comments)
comments
- The String to become the Parameter comments.
This may be null to remove all comments.
public Parameter Parent()
A parent Parameter is always an aggregate that contains this Parameter in its aggregate list.
public PVL_Exception Warning()
When conditions are encountered that are unusual enough to warrant
attention, but not an error condition that would prevent successful
processing which would cause an exception to be thrown, a warning
condition is registered. The warning is in the form of a
PVL_Exception that was not thrown. The current warning status is
either the
or the First_Warning
since a Last_Warning
.
Reset_Warning
PVL_Exception
,
First_Warning(boolean)
,
Last_Warning(boolean)
,
Reset_Warning()
public Parameter Reset_Warning()
Warning
method
will return null until the next warning condition occurs.
Warning()
public Parameter First_Warning(boolean first)
The first warning is one that occurs when the current warning status is null.
first
- true to enable returning the first warning status;
false to return the last warning that occurred as the current
warning status.
Warning()
,
First_Warning()
,
Reset_Warning()
public PVL_Exception First_Warning()
Reset_Warning
.
PVL_Exception
,
Warning()
,
First_Warning(boolean)
,
Reset_Warning()
public Parameter Last_Warning(boolean last)
The last warning is the most recent one regarless of any previous
warning conditions that may have occured without an intervening
Reset_Warning
.
last
- true to enable returning the last warning status;
false to return the first warning condition that occurred as
the current warning status.
Warning()
,
Last_Warning()
,
Reset_Warning()
public PVL_Exception Last_Warning()
Reset_Warning
.
PVL_Exception
,
Warning()
,
Last_Warning(boolean)
,
Reset_Warning()
public Object clone()
clone
in class DefaultMutableTreeNode
Parameter(Parameter)
,
Object.clone()
,
Cloneable
public boolean Match(Parameter parameter, Selector criteria)
parameter
- The Parameter to be compared to this Parameter.criteria
- The Selector providing the comparison criteria.
Selector
,
Selection
public boolean Match_Depth(Parameter parameter, Selector criteria)
If the Parameter is an Aggregate matching is done recursively on all Parameters of the Aggregate. The match succeeds if all Parameters match.
N.B.: To avoid unnecessary redundant recursive comparisons of
Aggregate parameter values if the Value
criteria is included in the selection the data
comparison
is only done for non-Aggregate Parameters.
parameter
- The Parameter to be compared to this Parameter.criteria
- The Selector providing the comparison criteria.
Selector
,
Selection
public boolean equals(Object object)
An Object is equal to this Parameter when it is also a Parameter
object and all of its contents are equal to this Parameter's contents.
A Selection object with PARAMETER_MATCH
criteria is
used with the Match_Depth
method.
equals
in class Object
object
- The Object to be compared to this Parameter.
Match_Depth(Parameter, Selector)
,
Selection
,
Selector.PARAMETER_MATCH
public boolean equalsIgnoreCase(Parameter parameter)
Unlike equals
, for a Parameter to be equivalent to this
Parameter the contents need only be logically equivalent, rather
than containing the identical contents. For example, shortening the
parameter list of an Aggregate by setting to
END_AGGREGATE
the classification of the first entry
that is different from the entries of another aggregate will result
in the two aggregates being logically equivalent. A Selection object
with PARAMETER_MATCH
but Specific (false)
criteria is used with the Match_Depth
method.
parameter
- The Parameter to be compared to this Parameter.
Match_Depth(Parameter, Selector)
,
Selection
,
Selector.PARAMETER_MATCH
,
Selection.Specific(boolean)
public int Write(Lister lister) throws PVL_Exception, IOException
lister
- The Lister to write the Parameter.
PVL_Exception
- BAD_ARGUMENT
IOException
- From the Lister's Write
method.Lister.Write(Parameter)
public int Write(OutputStream output, int level, boolean strict) throws PVL_Exception, IOException
A Lister is created with the output stream as its list destination using specified indent level and syntax strictness.
output
- The OutputStream to receive what is written.
If output is null System.out
is used.level
- The indent level at which to start the listing.
If the level is negative, indenting is disabled.strict
- Use strict PVL syntax if true; otherwise use an
easier to read format.
PVL_Exception
- BAD_ARGUMENT
IOException
- From the Lister's Write
method.Lister.Write(Parameter)
public int Write() throws PVL_Exception, IOException
System.out
starting at level 0, not strict.
PVL_Exception
- BAD_ARGUMENT
IOException
- From the OutputStream write
method.Write(OutputStream, int, boolean)
public int Write(boolean indent) throws PVL_Exception, IOException
System.out
with or without indenting, not strict.
indent
- Enable indenting starting at level 0 if true;
disable indenting otherwise.
PVL_Exception
- BAD_ARGUMENT
IOException
- From the OutputStream write
method.Write(OutputStream, int, boolean)
public int Write(boolean indent, boolean strict) throws PVL_Exception, IOException
System.out
with indenting and strict PVL enabled or disabled.
indent
- Enable indenting starting at level 0 if true;
disable indenting otherwise.strict
- Use strict PVL syntax if true; otherwise use an
easier to read format.
PVL_Exception
- BAD_ARGUMENT
IOException
- From the OutputStream write
method.Write(OutputStream, int, boolean)
public int Write(OutputStream output) throws PVL_Exception, IOException
output
- The OutputStream to receive what is written.
PVL_Exception
- BAD_ARGUMENT
IOException
- From the OutputStream write
method.Write(OutputStream, int, boolean)
public int Write(OutputStream output, boolean indent) throws PVL_Exception, IOException
output
- The OutputStream to receive what is written.indent
- Enable indenting starting at level 0 if true;
disable indenting otherwise.
PVL_Exception
- BAD_ARGUMENT
IOException
- From the OutputStream write
method.Write(OutputStream, int, boolean)
public int Write(OutputStream output, boolean indent, boolean strict) throws PVL_Exception, IOException
output
- The OutputStream to receive what is written.indent
- Enable indenting starting at level 0 if true;
disable indenting otherwise.strict
- Use strict PVL syntax if true; otherwise use an
easier to read format.
PVL_Exception
- BAD_ARGUMENT
IOException
- From the OutputStream write
method.Write(OutputStream, int, boolean)
public Iterator iterator(int index)
This Iterator does not descend into the lists of aggregate
Parameters in the current list. The DefaultMutableTreeNode
base class provdes various Enumeration
objects that will traverse the hierarchy in different orders.
In addition to implementing the Iterator interface, the
implementation for a Parameter treats END
Parameters
as the end of the list. The hasNext
method will return
false when the next Parameter in the list has an END
classification. To distinguish this case from the usual case when
the end of the list has been reached, the next
method
will include this information when it throws NoSuchElementException
at the end of the list. If the end of the list is as result of an
END
Parameter, then the getMessage
method
for the exception will contain the Classification_Name
as the first line (String terminated by a
new-line ('\n') character) of the message String. Otherwise the
message will only contain the ID of the Parameter class module (in
all cases a non-null message String will be provided). For example:
Iterator list = aggregate.iterator (); while (list.hasNext ()) { Parameter parameter = (Parameter)list.next (); // Do something with the parameter. } try {list.next ();} catch (NoSuchElementException exception) { if (exception.getMessage ().startsWith (Parameter.Classification_Name (Parameter.END))) { if (exception.getMessage ().startsWith (Parameter.Classification_Name (Parameter.END_PVL) + '\n')) // The END_PVL Parameter was encountered. else // An END_AGGREGATE was encountered. } }
A starting index beyond an END
Parameter may be
specified to skip over it.
For non-aggregate Parameters an "empty" Iterator will be provided. This will act the same as an Iterator on an empty list.
index
- The starting list element.
Iterator
,
Classification_Name()
,
DefaultMutableTreeNode
public Iterator iterator()
iterator(int)
public ListIterator listIterator(int index)
The functionality of the Parameter Iterator is provided (which it extends) with the ListIterator interface implemented.
As with the Parameter Iterator, END
Parameters are
treated as the end of the list. During reverse iteration
(hasPrevious
and previous
) END
Parameters mark an artificial beginning of the list, when the
start index is positioned beyond one. In this case the same special
message is provided with the NoSuchElementException object as for
the next
method.
Note: When the Parameter is an aggregate, but has no list,
an empty one is provided so the add
method will be
able to insert new Parameters into the list.
index
- The starting list element.
iterator()
,
ListIterator
public ListIterator listIterator()
listIterator(int)
public Parameter Find(Parameter test_parameter, Selector criteria, Parameter last_parameter)
A search is made of the Parameters contained in this aggregate, and, recursively, any aggregates it contains. The search is depth-wise: each aggregate Parameter is searched when it is encountered.
The search must first find the last_parameter (having the same object reference) before proceeding with the search for the test_parameter beginning with the Parameter following the last_parameter. If the last_parameter is null, then the search for the test_parameter begins with the first Parameter contained in this aggregate.
The search compares each Parameter encountered against the
test_parameter using the Selector criteria's
Parameters_Match
method. The first Parameter that
matches the test_parameter is returned. If the last_parameter or
a match for the test_parameter is not found, null is returned. If the
last_parameter could not be found a
PVL_Exception.NO_LAST_LOCATION
warning status is
registered with this Parameter. If this Parameter in which to
Find
is not an aggregate, null will be returned and a
PVL_Exception.ILLEGAL_SYNTAX
warning status will be
set.
The test_parameter may be any parameter, pre-existing or created ad hoc as a template for the Selector criteria. A Selector offers numerous criteria that may be conditionally applied when comparing the test_parameter with prospective mathing parameters. Note: The PIRL.PVL package provides a Selection class that implements the Selector interface.
In addition, when the Selector criteria enables Name
matching the search engine will
provide pathname tracking. This allows the name of the
test_parameter to be a full (absolute) or partial (relative)
pathname to a Parameter, of the form:
[ / ] Name [ /Name [...] ]
The name of the test_parameter may be a simple name; i.e. it contains
no
characters.
In this case a Parameter will be selected when its name matches the
test_parameter name entirely. A pathname beginning with a
Path_Delimiter
Path_Delimiter
character is "absolute" in that a
Parameter with a Name that matches the first segment of the pathname
must be found in this Parameter's aggregate list - the root of the
Find
- before the next segment of the pathname will
qualify for a match of a Parameter Name in the aggregate list of the
first Parameter matched; etc. Note: The first name of an
absolute pathname is not the name of this Parameter, it is the
name of the Parameter to find in the root aggregate list. All Parameters
in the pathname sequence must, of course, be aggregates except the
last Parameter (which may be of any classification). This is the same
as file pathnames in Unix. A pathname that does not begin with a
Path_Delimiter
is "relative" in that the first Name is
searched for like a simple name and then the remainder of the path is
searched for relative to the location of the first Parameter found.
The remainder of the pathname after the first name is treated like an
absolute pathname.
N.B.: The current warning status
is
reset
before the search begins.
test_parameter
- A Parameter object to use for testing
Parameters in this aggregate for a match. If null, or its
Name is null, null is immediately returned.criteria
- A Selector object providing the methods
to determine if Parameters match.last_parameter
- A Parameter object to be found within the
aggregate before search comparisons begin. If null, begin the
search at the first element of the aggregate list.
Find
is not an
aggregate, null will be returned and a
PVL_Exception.ILLEGAL_SYNTAX
warning status will
be set. If the last_parameter could not be found a
PVL_Exception.NO_LAST_LOCATION
warning status is
registered with this Parameter.Selector
,
Selection.Parameters_Match(Parameter, Parameter)
,
Path_Name()
public Parameter Find(String name)
The name string matching is case sensitive.
name
- The name or pathname String to search for. If null,
the empty String will be used.
Find(String, boolean, Parameter)
public Parameter Find(String name, Parameter last_parameter)
The name string matching is case sensitive.
name
- The name or pathname String to search for. If null,
the empty String will be used.last_parameter
- A Parameter object to be found within the
aggregate before search comparisons begin. If null, begin the
search at the first element of the aggregate list.
Find(String, boolean, Parameter)
public Parameter Find(String name, boolean case_sensitive)
name
- The name or pathname String to search for. If null,
the empty String will be used.case_sensitive
- true for the case sensitive name matching;
false for case insensitive name matching.
Find(String, boolean, Parameter)
public Parameter Find(String name, boolean case_sensitive, Parameter last_parameter)
name
- The name or pathname String to search for. If null,
the empty String will be used.case_sensitive
- true for the case sensitive name matching;
false for case insensitive name matching.last_parameter
- A Parameter object to be found within the
aggregate before search comparisons begin. If null, begin the
search at the first element of the aggregate list.
Find(Parameter, Selector, Parameter)
,
Selection.Name(boolean)
,
Selection.Specific(boolean)
public Parameter Find(int classification)
The classification matching is exact. For a general classification
match - e.g. a GROUP
will match with an
OBJECT
- use:
Find (new Parameter ().Classification (classification), new Selection ().Classification (true).Specific (false));
classification
- The classification code to search for.
Find(Parameter, Selector, Parameter)
public Parameter Find(int classification, Parameter last_parameter)
classification
- The classification code to search for.last_parameter
- A Parameter object to be found within the
aggregate before search comparisons begin. If null, begin the
search at the first element of the aggregate list.
Find(int)
,
Find(Parameter, Selector, Parameter)
public Parameter Find(String name, int classification)
Parameter pathname matching is specific (case sensitive) but classification matching is non-specific (any Aggregate type).
name
- The name or pathname String to search for. If null, the
empty String will be used.classification
- The classification code to search for.
Find(String, int, Parameter)
public Parameter Find(String name, int classification, Parameter last_parameter)
Parameter pathname matching is specific (case sensitive) but classification matching is non-specific (any Aggregate type).
name
- The name or pathname String to search for. If null, the
empty String will be used.classification
- The classification code to search for.last_parameter
- A Parameter object to be found within the
aggregate before search comparisons begin. If null, begin the
search at the first element of the aggregate list.
Find(String)
,
Find(int)
,
Find(Parameter, Selector, Parameter)
public Parameter Find(Parameter test_parameter)
A complete match requires an exact match of the name (which may be a pathname), classification, comments, and Value when the Parameter is an assignment. The Value match requires that the data and its type (as well as the numeric base for integers), and any units String all be exactly equal. Note: Parameter contents, not Parameter object references, are compared.
test_parameter
- The Parameter to use when testing for a
match.
Find(Parameter, Selector, Parameter)
public Parameter Find(Parameter test_parameter, Parameter last_parameter)
test_parameter
- The Parameter to use when testing for a
match.last_parameter
- A Parameter object to be found within the
aggregate before search comparisons begin. If null, begin the
search at the first element of the aggregate list.
Find(Parameter)
,
Find(Parameter, Selector, Parameter)
public Parameter Find(Parameter test_parameter, Selector criteria)
test_parameter
- The Parameter to use when testing for a
match.criteria
- A Selector object providing the methods
to determine if Parameters match.
Find(Parameter, Selector, Parameter)
public void setUserObject(Object object)
setUserObject
in interface MutableTreeNode
setUserObject
in class DefaultMutableTreeNode
object
- Since the userObject
of a Parameter is
it's name, only String objects are allowed for the argument.
Anything else is ignored and a
PVL_Exception.BAD_ARGUMENT
warning status is set.DefaultMutableTreeNode.setUserObject(Object)
public void setAllowsChildren(boolean allows)
setAllowsChildren
in class DefaultMutableTreeNode
allows
- Since the ability of a Parameter to have children
is totally determined by its classification (only aggregates
may have a children list), this argument is ignored and a
PVL_Exception.ILLEGAL_SYNTAX
warning status is
set.DefaultMutableTreeNode.setAllowsChildren(boolean)
public void add(MutableTreeNode parameter) throws IllegalArgumentException
Add
method.
add
in class DefaultMutableTreeNode
parameter
- A MutableTreeNode that must be a Parameter object.
IllegalArgumentException
- If the parameter argument is not
a Parameter object, or the Add
method threw a
PVL_Exception (in which case it's message is used for the
exception message).Add(Parameter)
,
DefaultMutableTreeNode.add(MutableTreeNode)
public void insert(MutableTreeNode parameter, int index) throws IllegalArgumentException
Insert
method.
insert
in interface MutableTreeNode
insert
in class DefaultMutableTreeNode
parameter
- A MutableTreeNode that must be a Parameter object.index
- The index in the aggregate list where the Parameter
is to be inserted.
IllegalArgumentException
- If the parameter argument is not
a Parameter object, or the Insert
method threw a
PVL_Exception (in which case it's message is used for the
exception message).Insert(Parameter, int)
,
DefaultMutableTreeNode.insert(MutableTreeNode, int)
public void remove(int index)
Remove
method.
remove
in interface MutableTreeNode
remove
in class DefaultMutableTreeNode
index
- The index of the element in the aggregate list to remove.Remove(int)
,
DefaultMutableTreeNode.remove(int)
public void remove(MutableTreeNode parameter) throws IllegalArgumentException
Remove
method.
remove
in interface MutableTreeNode
remove
in class DefaultMutableTreeNode
parameter
- A MutableTreeNode that must be a Parameter object.
IllegalArgumentException
- If the parameter argument is not
a Parameter object.Remove(Parameter)
,
DefaultMutableTreeNode.remove(MutableTreeNode)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |