Package owlsmx.data

Examples of owlsmx.data.ServiceConcept


    public static Map loadConceptServiceSet(String path) throws IOException {
        Map result = new HashMap();
        BufferedReader reader = new BufferedReader(new FileReader(path));
        String line;
        String[] tokens;
        ServiceConcept services;
        SortedSet entries;
        Iterator iter;
        while ( (line = reader.readLine()) != null) {
            line = line.trim();
            line = line.substring(line.indexOf("(")+1,line.lastIndexOf(")"));           
            tokens = line.split(";;;");
            services = new ServiceConcept();
            entries = entriesFromString(tokens[1]);
            iter = entries.iterator();
            while (iter.hasNext())
                services.addInput((ServiceEntry)iter.next());
            entries = entriesFromString(tokens[2]);
            iter = entries.iterator();
            while (iter.hasNext())
                services.addOutput((ServiceEntry)iter.next());
            result.put(tokens[0],services);
        }
       
        reader.close();
        return result;
View Full Code Here


   
    public static boolean saveConceptServiceSet(Map map, String targetpath) {
        try {
        FileWriter writer = new FileWriter(targetpath,false);
        Iterator iter = map.entrySet().iterator();
        ServiceConcept services;
        while ( iter.hasNext() ){
            Map.Entry me = (Map.Entry)iter.next();              
            services = (ServiceConcept)me.getValue();
            writer.write("(" + (String)me.getKey() + ";;;" + getStringFromEntries(services.getInputs()) + ";;;" + getStringFromEntries(services.getOutputs()) + ")\n");
          
        }
       
        writer.close();
        return true;
View Full Code Here

TOP

Related Classes of owlsmx.data.ServiceConcept

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.