org.eclipse.emf.compare.provider.utils

## Class ComposedStyledString

- java.lang.Object
- - org.eclipse.emf.compare.provider.utils.ComposedStyledString

All Implemented Interfaces:
  Iterable<IStyledString>, IStyledString.IComposedStyledString

    public class ComposedStyledString
    extends Object
    implements IStyledString.IComposedStyledString

Composed styled string implementation backed by an `ArrayList`.

### Constructor Summary

Constructors
Constructor and Description
`ComposedStyledString()` Creates a new empty instance.
`ComposedStyledString(String text)` Creates a new instance with the given text without style.
`ComposedStyledString(String text, IStyledString.Style style)` Creates a new instance with the given text and the given style.

### Method Summary

All Methods Instance Methods Concrete Methods
`IStyledString.IComposedStyledString` `append(IStyledString.IComposedStyledString composedStyledString)` Appends the given composed styled string to this.
`IStyledString.IComposedStyledString` `append(String str)` Append the given string with no style.
`IStyledString.IComposedStyledString` `append(String str, IStyledString.Style style)` Append the given string with the given style.
`String` `getString()` Returns the Java string for this composed styled string.
`Iterator<IStyledString>` `iterator()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Constructor Detail

#### ComposedStyledString

    public ComposedStyledString()

Creates a new empty instance.

#### ComposedStyledString

    public ComposedStyledString(String text)

Creates a new instance with the given text without style.

Parameters:
  `text` - the text.

#### ComposedStyledString

    public ComposedStyledString(String text,
                                IStyledString.Style style)

Creates a new instance with the given text and the given style.

Parameters:
  `text` - the text.
  `style` - the style of the text.

### Method Detail

#### getString

    public String getString()

Returns the Java string for this composed styled string.

Specified by:
  `getString` in interface `IStyledString.IComposedStyledString`
Returns:
  the Java string for this composed styled string.
See Also:
  `IStyledString.IComposedStyledString.getString()`

#### append

    public IStyledString.IComposedStyledString append(String str)

Append the given string with no style.

Specified by:
  `append` in interface `IStyledString.IComposedStyledString`
Parameters:
  `str` - the string to append.
Returns:
  this instance to let you chain the calls.
See Also:
  `org.eclipse.emf.compare.ide.ui.internal.util.IComposedStyledString#append(java.lang.String)`

#### append

    public IStyledString.IComposedStyledString append(String str,
                                                      IStyledString.Style style)

Append the given string with the given style.

Specified by:
  `append` in interface `IStyledString.IComposedStyledString`
Parameters:
  `str` - the string to append.
  `style` - the style of the appended string.
Returns:
  this instance to let you chain the calls.
See Also:
  `org.eclipse.emf.compare.ide.ui.internal.util.IComposedStyledString#append(java.lang.String, org.eclipse.emf.compare.ide.ui.internal.util.IComposedStyledString.Style)`

#### append

    public IStyledString.IComposedStyledString append(IStyledString.IComposedStyledString composedStyledString)

Appends the given composed styled string to this.

Specified by:
  `append` in interface `IStyledString.IComposedStyledString`
Parameters:
  `composedStyledString` - the styled string to append.
Returns:
  this instance.
Since:
  4.0
See Also:
  `IStyledString.IComposedStyledString.append(org.eclipse.emf.compare.provider.utils.IStyledString.IComposedStyledString)`

#### iterator

    public Iterator<IStyledString> iterator()

Specified by:
  `iterator` in interface `Iterable<IStyledString>`
See Also:
  `Iterable.iterator()`