Ignore:
Timestamp:
02/13/06 12:18:28 (19 years ago)
Author:
boris
Message:
  • create an abstract way to access omc class getElementsInfo() thus close the hole into omc plugin, hurray !
  • added some tests that triggerd some bugs and fixed the bugs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.omc/src/org/modelica/mdt/omc/OMCProxy.java

    r307 r310  
    4646import java.io.FileReader;
    4747import java.io.IOException;
     48import java.util.Collection;
     49import java.util.LinkedList;
    4850import java.util.StringTokenizer;
    4951
     
    5254import org.modelica.mdt.core.IModelicaClass;
    5355import org.modelica.mdt.core.List;
     56import org.modelica.mdt.core.ListElement;
    5457import org.modelica.mdt.core.compiler.ConnectException;
     58import org.modelica.mdt.core.compiler.ElementsInfo;
    5559import org.modelica.mdt.core.compiler.IModelicaCompiler;
    5660import org.modelica.mdt.core.compiler.InvocationError;
     
    687691    }
    688692   
    689     /**
    690      * @param className
    691      * @return
    692      * @throws ConnectException
    693      * @throws InvocationError
    694      * @throws UnexpectedReplyException
    695      */
    696     public List getElementsInfo(String className)
     693    public Collection<ElementsInfo> getElementsInfo(String className)
    697694        throws ConnectException, InvocationError, UnexpectedReplyException
    698695    {
     
    707704            if (retval.charAt(i) == '{')
    708705            {
    709                 /* we found the begining of the list, let's hope for the best */
    710                 return ModelicaParser.parseList(retval);       
     706                /*
     707                 * we found the begining of the list, send it to parser and
     708                 * hope for the best
     709                 */
     710                List parsedList = ModelicaParser.parseList(retval);
     711               
     712                /* convert the parsedList to a collection of ElementsInfo:s */
     713                LinkedList<ElementsInfo> elementsInfo =
     714                    new LinkedList<ElementsInfo>();
     715
     716                for (ListElement element : parsedList)
     717                {
     718                    elementsInfo.add(new ElementsInfo((List)element));
     719                }
     720               
     721                return elementsInfo;
    711722            }
    712723            else if (retval.charAt(i) == 'E' || retval.charAt(i) == 'e')
Note: See TracChangeset for help on using the changeset viewer.