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

net.sf.javagimmicks.collections8.diff.DifferenceList Maven / Gradle / Ivy

There is a newer version: 0.99-alpha1
Show newest version
package net.sf.javagimmicks.collections8.diff;

import java.util.List;

import net.sf.javagimmicks.collections8.diff.Difference.Range;

/**
 * Represents all single {@link Difference}s between two {@link List} - serves
 * as comparison result with the difference API.
 * 

* Note: a {@link DifferenceList} is defined to be read-only, so * implementors should ensure this. * * @param * the type of elements the compared {@link List}s carry */ public interface DifferenceList extends List> { /** * Returns an inverted version of this {@link DifferenceList} which means * that the delete and add {@link Range}s within the contained * {@link Difference}s are exchanged. * * @return an inverted version of this {@link DifferenceList} */ default DifferenceList invert() { return DifferenceUtils.getInvertedDifferenceList(this); } /** * Applies the {@link Difference}s contained in this {@link DifferenceList} * to a given "source" {@link List}. *

* This means - more formally - that if the source {@link List} is equal to * the "left side" of the original comparison it will after appliance be * equals to the "right side" of the original comparison. * * @param list * the {@link List} to apply the {@link Difference}s to */ default void applyTo(List list) { DifferenceUtils.applyDifferenceList(this, list); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy