/** * Sets the unencoded name of the class instance. * * @param clearname the unencoded name of the class instance. */ @Override public void setClearName(String clearname) { super.setClearName(clearname); if(_attr != null) _attr.setClearName(clearname); if(_attrTbl != null) _attrTbl.setClearName(clearname); }
/** * Constructs a new <code>BaseType</code> with name <code>n</code>. * Name is always assumed to be dap encoded * @param clearname the name of the variable. */ public BaseType(String clearname) { super(); _attrTbl = new AttributeTable(getClearName()); _attr = new Attribute(getClearName(), _attrTbl); setClearName(clearname); }
/** * Set the i'th value of the array. * * @param i the index of the value to set. * @param newVal the new value. */ public final void setValue(int i, BaseType newVal) { vals[i] = newVal; BaseType parent = (BaseType)getTemplate().getParent(); vals[i].setParent(parent); }
void dimension(DArray node, List<Object> dimensions) throws ParseException { int i; /* Interface requires rebuilding the dimensions */ for(Object o : dimensions) { DArrayDimension dim = (DArrayDimension) o; node.appendDim(dim.getSize(), dim.getClearName()); } }
/** * Adds a variable to the container. * * @param v the variable to add. */ public void addVariable(BaseType v) { vals = v.newPrimitiveVector(); setName(v.getName()); v.setParent(this); setContainerVar(v); // save v for cloning }
/** * Returns the attribute type constant. * * @return the attribute type constant. */ public int getType() { return (getMyAttribute().getType()); }
/** * Returns the <code>AttributeTable</code> container. * * @return the <code>AttributeTable</code> container. */ public AttributeTable getContainer() throws NoSuchAttributeException { return (getMyAttribute().getContainer()); }
/** * Returns the attribute value at <code>index</code>. * * @param index the index of the attribute value to return. * @return the attribute <code>String</code> at <code>index</code>. */ public String getValueAt(int index) throws NoSuchAttributeException { return (getMyAttribute().getValueAt(index)); }
/** * Returns the values of this attribute as an <code>Enumeration</code> * of <code>String</code>. * * @return an <code>Enumeration</code> of <code>String</code>. */ public Enumeration getValues() throws NoSuchAttributeException { return (getMyAttribute().getValues()); }
private void checkVectorUsage() throws NoSuchAttributeException { if(!(attr instanceof Vector)) { throw new NoSuchAttributeException( "The Attribute '" + getEncodedName() + "' is a container. " + "It's contents are Attribues, not values."); } }
/** * Constructs a new <code>BaseType</code> with name <code>n</code>. * * @param n the name of the variable. */ public BaseType(String n, boolean decodeName) { super(n,decodeName); _attrTbl = new AttributeTable(_name); _attr = new Attribute(_name, _attrTbl); }
private void checkVectorUsage() throws NoSuchAttributeException { if (!(attr instanceof Vector)) { throw new NoSuchAttributeException( "The Attribute '" + getName() + "' is a container. " + "It's contents are Attribues, not values."); } }
/** * Returns true if the attribute is a container. * * @return true if the attribute is a container. */ public boolean isContainer() { return (getMyAttribute().getType() == CONTAINER); }
/** * Sets the unencoded name of the class instance. * * @param n the unencoded name of the class instance. */ @Override public void setClearName(String n) { super.setClearName(n); if(_attr != null) _attr.setClearName(n); if(_attrTbl != null) _attrTbl.setClearName(n); }
/** * Returns the <code>AttributeTable</code> container. * * @return the <code>AttributeTable</code> container. */ public AttributeTable getContainer() throws NoSuchAttributeException { return (getMyAttribute().getContainer()); }
/** * Returns the attribute value at <code>index</code>. * * @param index the index of the attribute value to return. * @return the attribute <code>String</code> at <code>index</code>. */ public String getValueAt(int index) throws NoSuchAttributeException { return (getMyAttribute().getValueAt(index)); }
/** * Returns the values of this attribute as an <code>Enumeration</code> * of <code>String</code>. * * @return an <code>Enumeration</code> of <code>String</code>. */ public Enumeration getValues() throws NoSuchAttributeException { return (getMyAttribute().getValues()); }
private void checkContainerUsage() throws NoSuchAttributeException { if (_Debug) System.out.print("Attribute.checkContainerUsage(): "); if (!(attr instanceof AttributeTable)) { throw new NoSuchAttributeException( "The Attribute '" + getName() + "' is not a container (AttributeTable)." + "It's content is made up of values, not other Attributes."); } if (_Debug) System.out.println("The Attribute is a container"); }
/** * Returns true if the attribute is a container. * * @return true if the attribute is a container. */ public boolean isContainer() { return (getMyAttribute().getType() == CONTAINER); }