eu.europa.esig.dss.util.MutableTimeDependentValues Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dss-model Show documentation
Show all versions of dss-model Show documentation
DSS Model contains the data model representation for DSS
package eu.europa.esig.dss.util;
import java.util.Date;
import java.util.List;
/**
* Mutable list of time-dependent values.
*
* @author jdvorak
* @param
*/
public class MutableTimeDependentValues extends TimeDependentValues {
public MutableTimeDependentValues() {
super();
}
public MutableTimeDependentValues(final Iterable srcList) {
super(srcList);
}
public synchronized void clear() {
list.clear();
}
public synchronized void addOldest(final T x) {
if (x == null) {
throw new NullPointerException("Cannot add null");
}
if (!list.isEmpty()) {
final Date endDate = x.getEndDate();
for (final T y : list) {
if (endDate.compareTo(y.getStartDate()) > 0) {
throw new IllegalArgumentException("Cannot add overlapping item");
}
}
}
list.add(x);
}
public List getList() {
return list;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy