/*
 *  List of unified ALLL lists
 *
 *  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 java.util.LinkedList;

public class TStorageBuffer{
	
    LinkedList<TObject> PContent;

    public int getSize(){
        int size=0;
        for(TObject item:PContent){
            size=size+item.getContent().length();
        }
        return(size);
    }
			
    public boolean hasNext(){
        return(!PContent.isEmpty());
    }
		
    public TList next(){

        // get the first item and remove it from the list

        if(!PContent.isEmpty()){
            TList result=(TList)PContent.getFirst();
            PContent.removeFirst();
            return(result);
	} 
	return(null);
    }

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

    public TStorageBuffer(LinkedList<TObject> list){
        PContent=list;
    }

}
