- }\r
- \r
- @Override\r
- public int getComponentCount() {\r
- return 1;\r
- }\r
- \r
- @Override\r
- public Datatype getComponentType(int index) {\r
- if (index!=0) throw new IllegalArgumentException();\r
- return componentType;\r
- }\r
- \r
- @Override\r
- public Datatype getComponentType(ChildReference path) {\r
- if (path==null) return this;\r
- if (path instanceof KeyReference) throw new IllegalArgumentException("KeyReference is not supported in OptionalType"); \r
- if (path instanceof NameReference) throw new IllegalArgumentException("NameReference is not supported in OptionalType"); \r
- if (path instanceof IndexReference && ((IndexReference) path).index!=0) throw new IllegalArgumentException("Index out of bounds");\r
- if (path instanceof LabelReference && !((LabelReference) path).label.equals("v")) throw new IllegalArgumentException("Unknown label");\r
- return componentType.getComponentType(path.childReference);\r
+ }
+
+ @Override
+ public int getComponentCount() {
+ return 1;
+ }
+
+ @Override
+ public Datatype getComponentType(int index) {
+ if (index!=0) throw new IllegalArgumentException();
+ return componentType;
+ }
+
+ @Override
+ public Datatype getComponentType(ChildReference path) {
+ if (path==null) return this;
+ if (path instanceof KeyReference) throw new IllegalArgumentException("KeyReference is not supported in OptionalType");
+ if (path instanceof NameReference) throw new IllegalArgumentException("NameReference is not supported in OptionalType");
+ if (path instanceof IndexReference && ((IndexReference) path).index!=0) throw new IllegalArgumentException("Index out of bounds");
+ if (path instanceof LabelReference && !((LabelReference) path).label.equals("v")) throw new IllegalArgumentException("Unknown label");
+ return componentType.getComponentType(path.childReference);