]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
refs #5224
authorvillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 26 Aug 2014 12:35:09 +0000 (12:35 +0000)
committervillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 26 Aug 2014 12:35:09 +0000 (12:35 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30142 ac1ea38d-2e2b-0410-8846-a27921b304fc

fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Array.java

index 8747c51898cf5985989a87dfe5e43ef5e31391fa..eaa4cca140e9536bb46f9aef7cbd7d099eed53e1 100644 (file)
@@ -78,7 +78,15 @@ public class Array implements IExpression {
        }\r
        \r
        public int size(int col) {\r
-               return elements.size();\r
+               \r
+               if(col == 1) return elements.size();\r
+\r
+               if(elements.isEmpty()) throw new IllegalStateException();\r
+               Object elem = element(0);\r
+               if(!(elem instanceof Array)) throw new IllegalStateException();\r
+               \r
+               return ((Array)elem).size(col-1);\r
+               \r
        }\r
        \r
        public Object element(int index) {\r