Statistics
| Revision:

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

History | View | Annotate | Download (1.03 KB)

1
package es.uji.lsi.wcs.XmlWcsParsing;
2
/*
3
 * SupportedFormats.java
4
 *
5
 * Created on 13 de enero de 2005, 15:18
6
 */
7
import java.util.*;
8
/**
9
 *
10
 * @author  jaume
11
 */
12
public class SupportedFormats {
13
    ArrayList formats = new ArrayList();
14
    /** Creates a new instance of SupportedFormats */
15
    public SupportedFormats(XMLNode node) {
16
        for (int i=0; i<node.getNumSubNodes(); i++){
17
            XMLNode subnode = node.getSubNode(i);
18
            if (WCSToolkit.isWCSTab(subnode, "formats")){
19
                if (formats == null) formats = new ArrayList();
20
                String[] s = subnode.getText().split(" +");
21
                for (int j=0; j<s.length; j++) formats.add(s[j]);
22
            } 
23
        }
24
    }
25
    
26
    public ArrayList getFormats(){
27
        return formats;
28
    }
29

    
30
    public String toString(){
31
        Iterator it = formats.iterator();
32
        String s = "\nSupported format(s): ";
33
        while (it.hasNext()){
34
            s += (String) it.next();
35
            if (it.hasNext()) s += ", ";
36
        }
37
        
38
        return s;
39
    }
40
}