/*
 *  ALLL data content class
 *
 *  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.jTMassModel.jModelData;

import jTMass.core.jALLL.TALLL;
import jTMass.core.jALLL.jTObjects.TList;
import jTMass.core.jALLL.jTObjects.TObject;

public class TALLLContent extends TContent{

   private TObject PALLLContent;

   // ===== DATA PARSING =====

   TObject getObjectsALLL(String content){
        if(content.contentEquals(""))
            return(null);
        TObject result=TALLL.parseALLLData(content);
        return(result);
   }

   // ===== INTEM ACCESS METHODS =====

   public TObject getItem(int i){
       TList list=(TList)PALLLContent;
       return(list.get(i));
   }

   public String getItemS(int i){
       TList list=(TList)PALLLContent;
       return(list.get(i).getContent().toString());
   }

   public Integer getItemI(int i){
       TList list=(TList)PALLLContent;
       Integer result;
       try{
            result=Integer.parseInt(list.get(i).getContent().toString());
        }catch(Exception e){
            result=0;
        }
        return(result);
   }

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

    public TALLLContent(String content){
        super(content);
        PALLLContent=getObjectsALLL(content);
    }

    public TALLLContent(TObject alllContent){
        super(alllContent.getContent());
        PALLLContent=alllContent;
    }

}