AttributedString(AttributedCharacterIterator[] iterators){
  if (iterators == null) {
    throw new NullPointerException("Iterators must not be null");
  }
  if (iterators.length == 0) {
    text="";
  }
 else {
    StringBuffer buffer=new StringBuffer();
    for (int counter=0; counter < iterators.length; counter++) {
      appendContents(buffer,iterators[counter]);
    }
    text=buffer.toString();
    if (text.length() > 0) {
      int offset=0;
      Map<Attribute,Object> last=null;
      for (int counter=0; counter < iterators.length; counter++) {
        AttributedCharacterIterator iterator=iterators[counter];
        int start=iterator.getBeginIndex();
        int end=iterator.getEndIndex();
        int index=start;
        while (index < end) {
          iterator.setIndex(index);
          Map<Attribute,Object> attrs=iterator.getAttributes();
          if (mapsDiffer(last,attrs)) {
            setAttributes(attrs,index - start + offset);
          }
          last=attrs;
          index=iterator.getRunLimit();
        }
        offset+=(end - start);
      }
    }
  }
}

AttributedString ( AttributedCharacterIterator [ ] iterators ) { if ( iterators == null ) { throw new NullPointerException ( "Iterators must not be null" ) ; } if ( iterators . length == 0 ) { text = "" ; } else { StringBuffer buffer = new StringBuffer ( ) ; for ( int counter = 0 ; counter < iterators . length ; counter ++ ) { appendContents ( buffer , iterators [ counter ] ) ; } text = buffer . toString ( ) ; if ( text . length ( ) > 0 ) { int offset = 0 ; Map < Attribute , Object > last = null ; for ( int counter = 0 ; counter < iterators . length ; counter ++ ) { AttributedCharacterIterator iterator = iterators [ counter ] ; int start = iterator . getBeginIndex ( ) ; int end = iterator . getEndIndex ( ) ; int index = start ; while ( index < end ) { iterator . setIndex ( index ) ; Map < Attribute , Object > attrs = iterator . getAttributes ( ) ; if ( mapsDiffer ( last , attrs ) ) { setAttributes ( attrs , index - start + offset ) ; } last = attrs ; index = iterator . getRunLimit ( ) ; } offset += ( end - start ) ; } } } }
constructs an attributedstring instance with the given attributedcharacteriterators .
