kites.TRSModel
Class TRSFile

java.lang.Object
  extended by kites.TRSModel.TRSFile

public class TRSFile
extends java.lang.Object

This class holds a complete TRS, including its instance, if specified in the source file


Field Summary
(package private)  ASTNode instance
          The instance given in the source file
(package private)  java.util.LinkedList<Rule> rules
          The list of rules which comprise the TRS
 
Constructor Summary
TRSFile()
          Creates a TRS without rules or instance.
 
Method Summary
 void add(Rule rule)
          Add a rule to the TRS.
 ASTNode getInstance()
          Gives the instance of this TRS
 java.util.Iterator<Rule> getRules()
          Gives an iterator over the TRS's rules.
 java.util.LinkedList<Rule> getRulesList()
          Gives a list of all the rules in the TRS.
 void setInstance(ASTNode instance)
          Set the TRS's instance.
 java.lang.String toString()
          Gives the String representation of this TRS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rules

java.util.LinkedList<Rule> rules
The list of rules which comprise the TRS


instance

ASTNode instance
The instance given in the source file

Constructor Detail

TRSFile

public TRSFile()
Creates a TRS without rules or instance.

Method Detail

add

public void add(Rule rule)
Add a rule to the TRS.

Parameters:
rule - The rule to add

getInstance

public ASTNode getInstance()
Gives the instance of this TRS

Returns:
The TRS's instance if previously set, null otherwise

setInstance

public void setInstance(ASTNode instance)
Set the TRS's instance.

Parameters:
instance - The instance to set

getRules

public java.util.Iterator<Rule> getRules()
Gives an iterator over the TRS's rules.

Returns:
The iterator

getRulesList

public java.util.LinkedList<Rule> getRulesList()
Gives a list of all the rules in the TRS.

Returns:
The list

toString

public java.lang.String toString()
Gives the String representation of this TRS

Overrides:
toString in class java.lang.Object
Returns:
The String representation