private void addDecoration(Decoration d,int index){
  if (decorations != null) {
    decorationStarts=addToVector(d,index,decorations,decorationStarts);
  }
 else   if (decoration == null) {
    decoration=d;
  }
 else {
    if (!decoration.equals(d)) {
      decorations=new Vector<Decoration>(INITIAL_SIZE);
      decorations.addElement(decoration);
      decorations.addElement(d);
      decorationStarts=new int[INITIAL_SIZE];
      decorationStarts[0]=0;
      decorationStarts[1]=index;
    }
  }
}

private void addDecoration ( Decoration d , int index ) { if ( decorations != null ) { decorationStarts = addToVector ( d , index , decorations , decorationStarts ) ; } else if ( decoration == null ) { decoration = d ; } else { if ( ! decoration . equals ( d ) ) { decorations = new Vector < Decoration > ( INITIAL_SIZE ) ; decorations . addElement ( decoration ) ; decorations . addElement ( d ) ; decorationStarts = new int [ INITIAL_SIZE ] ; decorationStarts [ 0 ] = 0 ; decorationStarts [ 1 ] = index ; } } }
add a new decoration run with the given decoration at the given index .
