@Override public boolean isArrayDescribed() { if(_current instanceof ArrayElement) { return ((ArrayElement)_current).isDescribed(); } throw new IllegalStateException("Current value not array"); }
@Override public boolean isArrayDescribed() { if(_current instanceof ArrayElement) { return ((ArrayElement)_current).isDescribed(); } throw new IllegalStateException("Current value not array"); }
@Override public boolean isArrayDescribed() { if(_current instanceof ArrayElement) { return ((ArrayElement)_current).isDescribed(); } throw new IllegalStateException("Current value not array"); }
@Override String startSymbol() { return String.format("%s%s[", isDescribed() ? "D" : "", getArrayDataType()); }
@Override String startSymbol() { return String.format("%s%s[", isDescribed() ? "D" : "", getArrayDataType()); }
public long count() { int count = 0; Element elt = _first; while(elt != null) { count++; elt = elt.next(); } if(isDescribed() && count != 0) { count--; } return count; }
public long count() { int count = 0; Element elt = _first; while(elt != null) { count++; elt = elt.next(); } if(isDescribed() && count != 0) { count--; } return count; }
public long count() { int count = 0; Element elt = _first; while(elt != null) { count++; elt = elt.next(); } if(isDescribed() && count != 0) { count--; } return count; }
protected boolean isElementOfArray() { return _parent instanceof ArrayElement && !(((ArrayElement)parent()).isDescribed() && this == _parent.child()); }
protected boolean isElementOfArray() { return _parent instanceof ArrayElement && !(((ArrayElement)parent()).isDescribed() && this == _parent.child()); }
protected boolean isElementOfArray() { return _parent instanceof ArrayElement && !(((ArrayElement)parent()).isDescribed() && this == _parent.child()); }
@Override public Element addChild(Element element) { if(isDescribed() || element.getDataType() == _arrayType) { _first = element; return element; } else { Element replacement = coerce(element); if(replacement != null) { _first = replacement; return replacement; } throw new IllegalArgumentException("Attempting to add instance of " + element.getDataType() + " to array of " + _arrayType); } }
@Override public Element addChild(Element element) { if(isDescribed() || element.getDataType() == _arrayType) { _first = element; return element; } else { Element replacement = coerce(element); if(replacement != null) { return replacement; } throw new IllegalArgumentException("Attempting to add instance of " + element.getDataType() + " to array of " + _arrayType); } }
@Override public Element addChild(Element element) { if(isDescribed() || element.getDataType() == _arrayType) { _first = element; return element; } else { Element replacement = coerce(element); if(replacement != null) { _first = replacement; return replacement; } throw new IllegalArgumentException("Attempting to add instance of " + element.getDataType() + " to array of " + _arrayType); } }
@Override public Object[] getValue() { if(isDescribed()) { DescribedType[] rVal = new DescribedType[(int) count()]; Object descriptor = _first == null ? null : _first.getValue(); Element element = _first == null ? null : _first.next(); int i = 0; while(element != null) { rVal[i++] = new DescribedTypeImpl(descriptor, element.getValue()); element = element.next(); } return rVal; } else { Object[] rVal = new Object[(int) count()]; Element element = _first; int i = 0; while (element!=null) { rVal[i++] = element.getValue(); element = element.next(); } return rVal; } }
@Override public Object[] getValue() if(isDescribed())
@Override public Object[] getValue() if(isDescribed())