public boolean add(Outlier outlier) {
if (this.outlierLists.isEmpty()) {
return this.outlierLists.add(new OutlierList(outlier));
}
else {
boolean updated = false;
for (Iterator iterator = this.outlierLists.iterator();
iterator.hasNext();) {
OutlierList list = (OutlierList) iterator.next();
if (list.isOverlapped(outlier)) {
updated = updateOutlierList(list, outlier);
}
}
if (!updated) {
//System.err.print(" creating new outlier list ");
updated = this.outlierLists.add(new OutlierList(outlier));
}
return updated;
}
}
Appends the specified element as a new OutlierList to the
end of this list if it does not overlap an outlier in an existing list.
If it does overlap, it is appended to the outlier list which it overlaps
and that list is updated. |