
import latte.lattice.*;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//test Lattice Construction
		Lattice $lat1 = testLatticeConstruction();
		
		//test getCopyDontClone fine
		//System.out.println($lat1.getCopyDontClone().toString());
		
		//tet copyThisDontClone fine
		//System.out.println($lat1.copyThisDontClone($lat1).toString());
		
		//test clone fine
		//System.out.println($lat1.clone().toString());
		
		//test getWordClone wrong
		//System.out.println($lat1.getType());
		
		//Test replaceWithClone 
	    // 
		
		//Test replace 
	  // 
		
		//test isinitialized fine
		if($lat1.isInitialized())
       System.out.println("true");
		
		//test getWord() Unhandled exception type
		//Element word=$lat1.getWord();
		
		//test getType() fine
		int x=$lat1.getType();
		 System.out.println(x);
		 
		//test isElement fine
			if(!$lat1.isElement())
	       System.out.println("false");
			
			//test getVector  Vector cannot be resolved to a type
			//Vector<Lattice> V=$lat1.getVector();
			
			//test getVectorClone  Vector cannot be resolved to a type
			//Vector<Lattice> V=$lat1.getVectorClone();
			
             //test initIterator fine
			$lat1.initIterator();
			
			//test hasNext() fine
			$lat1.hasNext();
		   
			//test next() fine
			$lat1.next();
			
			/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
			 * * * * * * * * * *    TEST OPERATIONS ON LATTICES          * * * * * * * * * * * * * * 
			 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
			//test reverse  WRD 4 and WRD 7 has been reversed, but others are not reversed.
			$lat1.reverse();
		//	System.out.println($lat1.toString());
			
			//test concatenate(lattice lattice) fine
			$lat1.concatenate($lat1);
			//System.out.println($lat1.toString());
		
			//test new concatenate(lat 1, lat2) fine
		 Lattice $lat2=new Lattice(Lattice.SEQ);
		 Element y=new Element("x");
		 $lat2.concatenate(y);
		 System.out.println($lat2.toString());
		 Lattice $lat3=new Lattice();
		 $lat3=Lattice.concatenate($lat2,$lat1);
		 System.out.println($lat3.toString());
			
			
					
			
	}
	
	public static Lattice testLatticeConstruction() {
		Lattice $lat1 = new Lattice (Lattice.SEQ);
		// GenBy: Int
		Element ll_x_1 = new Element ("7");
		// GenBy: seqlat
		$lat1.concatenate(ll_x_1);
		// GenBy: altlat
		Lattice _altlat_1 = new Lattice (Lattice.OR);
		_altlat_1.addAlternative(new Element("2"));
		_altlat_1.addAlternative(new Element("0"));
		$lat1.concatenate(_altlat_1);
		$lat1.concatenate(new Element ("4"));
		System.out.println($lat1.toString());
		return $lat1;

	}
	

}
