|
PMII - JAVA-Packages - Principia Mathematica II | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Every Operator must implement this interface. Each operator deals with
arguments.
These arguments form an ordered list. So there is the number of
arguments,
which is told by getArgumentSize()
and the i
-th
argument,
accessible by getArgument(int)
.
Method Summary | |
boolean |
containsPatternVariables()
Does this argument contain any PatternVariable? |
Argument |
copy()
Returns an identical object (maybe "this"). |
Argument |
create(Argument[] arguments)
Create a new Argument with given arguments. |
boolean |
equals(Object object)
Is this object equal to the given one? |
Argument |
getArgument(int i)
Get the requested argument. |
int |
getArgumentSize()
Get the number of arguments. |
PatternVariables |
getPatternVariables()
Get all pattern variables that occur in this argument. |
void |
getReplacementParents(Enumerator counter,
int occurence,
Argument searchPattern,
Argument replacementPattern)
Get a children parents list for the occurrence -th
occurence of searchPattern replaced by
replacementPattern . |
void |
getSearchParents(Enumerator counter,
int occurence,
Argument searchPattern)
Get a children parents list for the occurrence -th
occurence of searchPattern . |
int |
hashCode()
Calculates the hashcode. |
boolean |
matches(Argument pattern)
Does any part of this argument match the pattern ?
|
boolean |
matches(Argument pattern,
PatternVariables variables)
Does this argument match the pattern ?
|
Argument |
replace(Argument search,
Argument replacement)
Creates and returns a copy of this object, but replaces anything that equals(java.lang.Object) argument
with a copy() of replacement . |
Argument |
replace(Enumerator counter,
int occurrence,
Argument searchPattern,
Argument replacePattern)
Replace the occurrence -th occurence of
searchPattern with replacePattern . |
Argument |
replace(PatternVariables variables)
Replace every pattern variable that occurs in variables with its content. |
Argument |
replaceMatches(Argument searchPattern,
Argument replacePattern)
Replace all occurrences of searchPattern with
replacePattern . |
String |
toString()
Get the argument in String form. |
Method Detail |
public int getArgumentSize()
public Argument getArgument(int i) throws IllegalArgumentException
i
- number of argument (starting with 0
)i
-th part formulaIllegalArgumentException
- if i
is not inbetween
0
and getArgumentSize()
- 1
public boolean equals(Object object)
object
is an instance of Argument
and
both arguments have the same
getArgumentSize()
and each getArgument(int)
equals(java.lang.Object)
.equals
in class Object
object
- to compare withobject
equal to this one?public int hashCode()
hashCode
in class Object
public Argument copy()
public Argument replace(Argument search, Argument replacement) throws ArgumentException
equals(java.lang.Object)
argument
with a copy()
of replacement
.search
- check for occurrence of thisreplacement
- replace with thisArgumentException
- if creation failedpublic Argument replace(PatternVariables variables) throws ArgumentException
variables
with its content.variables
- List of (filled) pattern variablesvariables
) are replaced with
its contentArgumentException
- if creation failedpublic Argument replace(Enumerator counter, int occurrence, Argument searchPattern, Argument replacePattern) throws ArgumentException
occurrence
-th occurence of
searchPattern
with replacePattern
.counter
- number of matches so faroccurrence
- number of matches to act onsearchPattern
- pattern for matchingreplacePattern
- pattern for replacing matched pattern withArgumentException
- if creation failedpublic void getSearchParents(Enumerator counter, int occurence, Argument searchPattern) throws FoundException
occurrence
-th
occurence of searchPattern
.counter
- number of matches so faroccurrence
- number of matches to act onsearchPattern
- pattern for matchingFoundException
- if creation succededpublic void getReplacementParents(Enumerator counter, int occurence, Argument searchPattern, Argument replacementPattern) throws FoundException, ArgumentException
occurrence
-th
occurence of searchPattern
replaced by
replacementPattern
.counter
- number of matches so faroccurrence
- number of matches to act onsearchPattern
- pattern for matchingreplacementPattern
- replacement patternFoundException
- if creation succededpublic Argument replaceMatches(Argument searchPattern, Argument replacePattern) throws ArgumentException
searchPattern
with
replacePattern
.searchPattern
- pattern for matchingreplacePattern
- pattern for replacing matched pattern withArgumentException
- if creation failedpublic boolean matches(Argument pattern, PatternVariables variables)
pattern
?
For example: "A1 n A1" matches the pattern "@0 n @1" with resulting
variables {@0(A1), @1(A1)}.
Be carefull, after an unsuccessful matching, some pattern
variables could have been found, so variables
might contain some filled pattern variables.pattern
- argument build of pattern variablesvariables
- already known pattern variablespublic boolean matches(Argument pattern)
pattern
?
For example: "A1 n A1" matches the pattern "@0 n @1",
"A1 v A2 matches the pattern "A2".pattern
- argument build of pattern variablespublic boolean containsPatternVariables()
PatternVariable
public PatternVariables getPatternVariables()
public Argument create(Argument[] arguments) throws ArgumentException
arguments
- with these arguments the operator should
be createdArgumentException
- if creation failedpublic String toString()
String
form.toString
in class Object
|
PMII - JAVA-Packages - Principia Mathematica II | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
©left GNU General Public Licence All Rights Reserved. |