net.sf.javagimmicks.collections.diff.DefaultDifferenceList Maven / Gradle / Ivy
Show all versions of gimmicks Show documentation
package net.sf.javagimmicks.collections.diff;
import java.util.ArrayList;
import java.util.List;
import net.sf.javagimmicks.collections.decorators.AbstractUnmodifiableListDecorator;
/**
* Provides a default implementation for {@link DifferenceList}.
*
* Note: a modifiable view to this {@link DifferenceList} can be obtained
* via the inherited {@link #getDecorated()} method - but this should
* never be called by non-API clients!
*/
public class DefaultDifferenceList extends AbstractUnmodifiableListDecorator> implements
DifferenceList
{
private static final long serialVersionUID = -8782622138787742405L;
/**
* Creates a new empty instance
*/
public DefaultDifferenceList()
{
super(new ArrayList>());
}
@Override
public void applyTo(final List list)
{
DifferenceUtils.applyDifferenceList(this, list);
}
@Override
public DifferenceList invert()
{
return DifferenceUtils.getInvertedDifferenceList(this);
}
@Override
public List> getDecorated()
{
return super.getDecorated();
}
}