/*
 *  Root class for the ALLL objects
 *
 *  2004 - 2011 Frantisek Zboril jr.
 *  Faculty of Information Technology
 *  zborilf@fit.vutbr.cz
 *  http://www.fit.vutbr.cz/~zborilf
 *
 * (C) Brno University of Technology
 * Freeware licence VUT v Brně
 * https://wis.fit.vutbr.cz/FIT/db/dir.php/dr/VZ2007/externiInformace/softwareNaWebu/Priloha2_rozh23.pdf

 */

package jTMass.core.jALLL.jTObjects;

import jTMass.core.jAMass.TAgent;

public class TObject {
	
    protected int PType;

    protected void setType(int type){
        PType=type;
    }
	
    public TObject substituteRegisters(TAgent agent){
        return(this);
    }
	
    public TObject substituteRegisters(TAgent agent, int regNumber){
	return(this);
    }

    public void matureRegisters(){
        return;
    }
	
    public TObject cloneObject(){
	return(new TObject(PType));	
    }
	
    public static boolean equals(TObject first,TObject second){

        if((first==null) || (second==null))
	if((first==null) && (second==null))
            return(true);
	else
            return(false);

	if((first.getType()==TConstants._AnonymousVariable)||
                (second.getType()==TConstants._AnonymousVariable))
				return(true);
		return((first.getContent().compareTo(second.getContent())==0));
    }
	
    public int getType(){
	return(PType);
    }
	
    public String getContent(){
	return("~Object "+this.toString()+"~");
    }

    // ====== CONSTRUCTORS =====

    public TObject(){
    }
	
    public TObject(int type){
    	PType=type;
    }
}
