All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.reactfx.collection.ListModificationSequence Maven / Gradle / Ivy

There is a newer version: 2.0-M5
Show newest version
package org.reactfx.collection;

import java.util.Iterator;
import java.util.List;

import org.reactfx.util.Lists;

/**
 * Common supertype for {@link QuasiListChange} and {@link ListChangeAccumulator}.
 *
 * @param  type of list elements
 */
public interface ListModificationSequence
extends AbstractListModificationSequence> {

    /**
     * May be destructive for this object. Therefore, this object should not
     * be used after the call to this method, unless stated otherwise by the
     * implementing class/interface.
     */
    QuasiListChange asListChange();

    /**
     * May be destructive for this object. Therefore, this object should not
     * be used after the call to this method, unless stated otherwise by the
     * implementing class/interface.
     */
    ListChangeAccumulator asListChangeAccumulator();
}

interface AbstractListModificationSequence>
extends Iterable {

    List getModifications();

    @Override
    default Iterator iterator() {
        return Lists.readOnlyIterator(getModifications());
    }

    default int getModificationCount() {
        return getModifications().size();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy