Hilbert II - JAVA-Packages - Principia Mathematica II

com.meyling.principia.argument
Class AbstractDynamicArgumentList

java.lang.Object
  extended bycom.meyling.principia.argument.AbstractArgument
      extended bycom.meyling.principia.argument.AbstractDynamicArgumentList
All Implemented Interfaces:
Argument
Direct Known Subclasses:
AuthorList, ImportList, LocationList, Module, Paragraph, ParagraphList, ProofLineList, Proposition, RuleDeclaration, UsedbyList, VariableList

public abstract class AbstractDynamicArgumentList
extends AbstractArgument
implements Argument

Every Operator with dynamic number of arguments must inherit from this class. Its main function is to provide the standard implemention of AbstractArgument.equals(java.lang.Object), AbstractArgument.matches(com.meyling.principia.argument.Argument, com.meyling.principia.argument.PatternVariables) and AbstractArgument.hashCode().

Version:
$Revision: 1.6 $
Author:
Michael Meyling

Constructor Summary
AbstractDynamicArgumentList(Argument[] arguments)
          Constructs an argument list.
 
Method Summary
 void add(Argument argument)
          Adds an argument to end of dynamic list.
 Argument copy()
          Returns an identical object (maybe "this").
abstract  Argument create(Argument[] arguments)
          Create a new Argument with given arguments.
 Argument getArgument(int i)
          Get the requested argument.
 int getArgumentSize()
          Get the number of arguments.
 void insert(int position, Argument argument)
          Inserts an argument to spezified position.
 void remove(int i)
          Deletes an argument of dynamic list.
 void replace(int position, Argument argument)
          Replaces an argument at spezified position.
abstract  String toString()
          Get the argument in String form.
 
Methods inherited from class com.meyling.principia.argument.AbstractArgument
containsPatternVariables, equals, getHighestNumber, getPatternVariables, getReplacementParents, getSearchParents, hashCode, matches, matches, replace, replace, replace, replaceMatches
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.meyling.principia.argument.Argument
containsPatternVariables, equals, getPatternVariables, getReplacementParents, getSearchParents, hashCode, matches, matches, replace, replace, replace, replaceMatches
 

Constructor Detail

AbstractDynamicArgumentList

public AbstractDynamicArgumentList(Argument[] arguments)
Constructs an argument list.

Parameters:
arguments - the arguments to make a list of
Throws:
IllegalArgumentException - if the argument was a nullpointer
Method Detail

add

public void add(Argument argument)
Adds an argument to end of dynamic list.

Parameters:
argument - argument to add
Throws:
IllegalArgumentException - if the given argument was a nullpointer

insert

public void insert(int position,
                   Argument argument)
Inserts an argument to spezified position.

Parameters:
position - position of argument to add
argument - argument to add
Throws:
IllegalArgumentException - if the given argument was a nullpointer or the position was not valid

replace

public void replace(int position,
                    Argument argument)
Replaces an argument at spezified position.

Parameters:
position - position of argument to replace
argument - replacement argument
Throws:
IllegalArgumentException - if the given argument was a nullpointer or the position was not valid

remove

public void remove(int i)
Deletes an argument of dynamic list.

Parameters:
i - position of argument to delete
Throws:
IllegalArgumentException - if the given position was not valid

getArgumentSize

public final int getArgumentSize()
Description copied from interface: Argument
Get the number of arguments.

Specified by:
getArgumentSize in interface Argument
Specified by:
getArgumentSize in class AbstractArgument

getArgument

public final Argument getArgument(int i)
                           throws IllegalArgumentException
Description copied from interface: Argument
Get the requested argument.

Specified by:
getArgument in interface Argument
Specified by:
getArgument in class AbstractArgument
Throws:
IllegalArgumentException

copy

public final Argument copy()
Description copied from interface: Argument
Returns an identical object (maybe "this").

Specified by:
copy in interface Argument
Returns:
copy of this object

create

public abstract Argument create(Argument[] arguments)
                         throws ArgumentException
Description copied from interface: Argument
Create a new Argument with given arguments.

Specified by:
create in interface Argument
Specified by:
create in class AbstractArgument
Throws:
ArgumentException

toString

public abstract String toString()
Description copied from interface: Argument
Get the argument in String form.

Specified by:
toString in interface Argument
Specified by:
toString in class AbstractArgument

Hilbert II - JAVA-Packages - Principia Mathematica II

©left GNU General Public Licence
All Rights Reserved.