Fixato bug e implementato alcune funzioni.

This commit is contained in:
2014-06-01 18:16:43 +02:00
parent 015d8cac76
commit e53f98a3a8
31 changed files with 910 additions and 151 deletions

View File

@@ -7,7 +7,7 @@ import set.OrderedListSet;
import set.Set;
import utility.DefaultComparator;
import java.security.InvalidKeyException;
import exceptions.InvalidKeyException;
import java.util.Iterator;
/**
@@ -40,23 +40,18 @@ public class ListPartition <E> implements Partition<E> {
@Override
public Set<E> makeSet(E x) {
try {
OrderedListSet<E> o = new OrderedListSet<E>(x, new DefaultComparator<E>());
elementi.put(x, o);
partizione.addLast(o);
o.setLocation(partizione.last());
return o;
}
catch (InvalidKeyException e){
}
return null;
}
@Override
public Set<E> union(Set<E> A, Set<E> B) {
try {
if (A.size() > B.size()){
OrderedListSet<E> AA = (OrderedListSet<E>) A;
OrderedListSet<E> BB = (OrderedListSet<E>) B;
@@ -82,23 +77,13 @@ public class ListPartition <E> implements Partition<E> {
}
}
catch (InvalidKeyException e){
}
return null;
}
@Override
public Set<E> find(E x) {
try {
return elementi.get(x);
}
catch (InvalidKeyException e){
}
return null;
return elementi.get(x);
}
@Override