@Override public int addAttribute(Attribute a){
  if (a == null) {
    throw new IllegalArgumentException("Attribute must not be null");
  }
 else {
    int index=-1;
    Attribute original=a;
    a=(Attribute)a.clone();
    if (unusedColumnList.size() > 0) {
synchronized (unusedColumnList) {
        if (unusedColumnList.size() > 0) {
          index=unusedColumnList.remove(0);
          attributes.set(index,a);
        }
 else {
          index=attributes.size();
          attributes.add(a);
        }
      }
    }
 else {
      index=attributes.size();
      attributes.add(a);
    }
    a.setTableIndex(index);
    original.setTableIndex(index);
    return index;
  }
}

@ Override public int addAttribute ( Attribute a ) { if ( a == null ) { throw new IllegalArgumentException ( "Attribute must not be null" ) ; } else { int index = - 1 ; Attribute original = a ; a = ( Attribute ) a . clone ( ) ; if ( unusedColumnList . size ( ) > 0 ) { synchronized ( unusedColumnList ) { if ( unusedColumnList . size ( ) > 0 ) { index = unusedColumnList . remove ( 0 ) ; attributes . set ( index , a ) ; } else { index = attributes . size ( ) ; attributes . add ( a ) ; } } } else { index = attributes . size ( ) ; attributes . add ( a ) ; } a . setTableIndex ( index ) ; original . setTableIndex ( index ) ; return index ; } }
adds the attribute to the list of attributes assigning it a free column index . if the name is already in use , the attribute will be renamed .
