summaryrefslogtreecommitdiffstats
path: root/src/syntaxParser/EncodedCoverageExpr.java
blob: 3f5f2837a779255544be3803d5019cc68cbba35e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package syntaxParser;
/**
 * EncodedCoverageExpr
 * Creation date: (3/3/2003 2:28:43 AM)
 * @author: mattia parigiani, Sorin Stancu-Mara
 */
class EncodedCoverageExpr implements IParseTreeNode {
	CoverageExpr coverageExpr;
	String formatName;
	String extraParams;
	boolean store;
	public EncodedCoverageExpr( CoverageExpr ce , String fn ){
		coverageExpr = ce;
		formatName = fn;
		extraParams = null;
		store = false;
	}
	
	public EncodedCoverageExpr( CoverageExpr ce , String fn, String ep ){
		coverageExpr = ce;
		formatName = fn;
		extraParams = ep;
		store = false;
	}	
	
	public void setStoreFlag() {
	    store = true;
	}

	public String toXML(){
		String result=  "<encode>"  ;
		if (store)  result = "<encode store=\"true\">";
		
		result += "<format>" + formatName + "</format>" ;
		if (extraParams != null ) { 
		    result += "<extraParams>" + extraParams + "</extraParams>" ;   
		}
		result +=  coverageExpr.toXML()  ;			
		result+=  "</encode>"  ;
		return result;
	}	
}