Statistics
| Revision:

root / trunk / extensions / extWCS / src / es / uji / lsi / wcs / XmlWcsParsing / RangeSet.java @ 1877

History | View | Annotate | Download (2.61 KB)

1
package es.uji.lsi.wcs.XmlWcsParsing;
2
/*
3
 * RangeSet.java
4
 *
5
 * Created on 8 de enero de 2005, 13:39
6
 */
7
import java.util.*;
8

    
9
/**
10
 *
11
 * @author  jaume
12
 */
13
public class RangeSet {
14
    private String metadataLink;
15
    private String description;
16
    private String name;
17
    
18
    private String label;
19
    private ArrayList axisDescriptionList = new ArrayList();
20
    private ArrayList nullValuesList = new ArrayList();
21
    
22
    /** Creates a new instance of RangeSet */
23
    public RangeSet(XMLNode node) {
24
        if (WCSToolkit.isWCSTab(node.getSubNode(0), "RangeSet")) node = node.getSubNode(0);
25
        for (int i=0; i<node.getNumSubNodes();i++){
26
            XMLNode subnode = node.getSubNode(i);
27

    
28
            if (WCSToolkit.isWCSTab(subnode, "metadataLink")) metadataLink = subnode.getText();
29
            if (WCSToolkit.isWCSTab(subnode, "description")) description = subnode.getText();
30
            if (WCSToolkit.isWCSTab(subnode, "name")) name = subnode.getText();
31
            if (WCSToolkit.isWCSTab(subnode, "label")) label = subnode.getText();
32
            if (WCSToolkit.isWCSTab(subnode, "axisDescription")) axisDescriptionList.add(new AxisDescription(subnode)); 
33
            if (WCSToolkit.isWCSTab(subnode, "nullValues")) nullValuesList.add(new NullValues(subnode));
34
        }
35
    }
36
    
37
     public String getMetadataLink(){
38
        return metadataLink;
39
    }
40
    
41
    public String getDescription(){
42
        return description;
43
    }
44
    
45
    public String getName(){
46
        return name;
47
    }
48
    
49
    public String getLabel(){
50
        return label;
51
    }
52
    
53
    public ArrayList getAxisDescriptionList(){
54
        return axisDescriptionList;
55
    }
56
    
57
    public AxisDescription getAxisDescription(String name){
58
        ArrayList al = getAxisDescriptionList();
59
        Iterator it = al.iterator();
60
        while (it.hasNext()){
61
            AxisDescription ad = (AxisDescription) it.next();
62
            if (ad.getName().equals(name))
63
                return ad;
64
        }
65
        return null;
66
    }
67
    
68
    public ArrayList getNullValuesList(){
69
        return nullValuesList;
70
    }
71
    public String toString(){
72
        String s, s2;
73
        s = "";
74
        s2 = "";
75
        Iterator it = axisDescriptionList.iterator();
76
        while (it.hasNext())
77
            s += it.next().toString();
78
        
79
        it = nullValuesList.iterator();
80
        while (it.hasNext())
81
            s2 += it.next().toString();
82
        
83
        return "\nRANGE SET\nname: "+getName()+"\ndescription: "+getDescription()+
84
               "\nlabel: "+getLabel()+"\nmetadata link: "+getMetadataLink()+
85
               "\nAxisDescriptions: "+s+"\nNull Values: "+s2;
86
        
87
    }
88
}