summaryrefslogtreecommitdiffstats
path: root/src/syntaxParser/CoverageExpr.java
blob: 516c061551f17474b5a435c94613dcc9b9a93f5c (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package syntaxParser;
/**
 * CoverageExpr
 * Creation date: (3/3/2003 2:28:43 AM)
 * @author: mattia parigiani, Sorin Stancu-Mara 
 */
class CoverageExpr implements IParseTreeNode {

	String coverageName;
	IParseTreeNode expr;
	String function;
	
	public CoverageExpr( String n ){	
		coverageName = n;
		function = "name";
	}
	
	public CoverageExpr( SetMetaDataExpr smde ){	
		expr = smde;
		function = "setMetaDataExpr";
	}	
	
	public CoverageExpr( InducedExpr ie ){	
		expr = ie;
		function = "inducedExpr";
	}
	
	public CoverageExpr( SubsetExpr se ){	
		expr = se;
		function = "subsetExpr";
	}		
	
	public CoverageExpr( CrsTransformExpr cte ){	
		expr = cte;
		function = "crsTransformExpr";
	}		

	public CoverageExpr( ScaleExpr se ){	
		expr =  se;
		function = "scaleExpr";
	}	
	
	public CoverageExpr( CoverageExpr ce ){	
		expr = ce;
		function = "coverageExpr";
	}	

	public CoverageExpr( CoverageConstructorExpr ce ){	
		expr = ce;
		function = "coverageConstructorExpr";
	}

	public String toXML(){
		String result=  ""  ;
		if (function.equals("name")) {
				result = "<coverage>" + coverageName + "</coverage>";
		} else 
			result = expr.toXML();		
		return result;
	}
}