Class AggregateCharSequence

  • All Implemented Interfaces:
    Serializable, CharSequence, IWritableCharSequence

    public final class AggregateCharSequence
    extends Object
    implements Serializable, IWritableCharSequence

    Character sequence that aggregates one or several CharSequence objects, without the need to clone them or convert them to String.

    Special implementation of the CharSequence interface that can replace String objects wherever a specific text literal is composed of several parts and we want to avoid creating new String objects for them, using instead objects of this class that simply keep an array of references to the original CharSequences.

    Note that any mutable CharSequence implementations used to build objects of this class should never be modified after the creation of the aggregated object.

    This class is thread-safe

    Daniel Fernández
    See Also:
    Serialized Form