/*
 *  Atomic object of the ALLL language
 *
 *  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;

public class TAtom extends TObject{

	protected String PContent;
        protected Integer PIntegerContent;

        @Override
	public TObject cloneObject(){
            TAtom newatom;
            if(PType==TConstants._Number)
		newatom=new TAtom(PIntegerContent);
            else
                newatom=new TAtom(PContent);
            newatom.setType(PType);
            return(newatom);
	}
	
	@Override
	public String getContent()
	{			
            if(PType==TConstants._Number)
                return(PIntegerContent.toString());
            return(PContent);
	}

        // ====== CONSTRUCTOR =====

	public TAtom(){
            super(TConstants._Uninitialized);
	}
	
	public TAtom(int t){
		super();
		if (t==TConstants._AnonymousVariable){
   			PContent=new String("_");
		}
		PType=t;	
	}

        public TAtom(Integer t){
		super(TConstants._Number);
		PIntegerContent=t;
	}

	public TAtom(String s){
		super(TConstants._ID);
		PContent=new String(s);
	}
}	

