Cluster cluster = (Cluster) value;
Vector vector = cluster.getCenter();
if (vector instanceof NamedVector) {
seedVectors.add((NamedVector) vector);
} else {
seedVectors.add(new NamedVector(vector, cluster.getIdentifier()));
}
} else if (valueClass.equals(Canopy.class)) {
// get the cluster info
Canopy canopy = (Canopy) value;
Vector vector = canopy.getCenter();
if (vector instanceof NamedVector) {
seedVectors.add((NamedVector) vector);
} else {
seedVectors.add(new NamedVector(vector, canopy.getIdentifier()));
}
} else if (valueClass.equals(Vector.class)) {
Vector vector = (Vector) value;
if (vector instanceof NamedVector) {
seedVectors.add((NamedVector) vector);
} else {
seedVectors.add(new NamedVector(vector, seedPathStr + '.' + item++));
}
} else if (valueClass.equals(VectorWritable.class) || valueClass.isInstance(VectorWritable.class)) {
VectorWritable vw = (VectorWritable) value;
Vector vector = vw.get();
if (vector instanceof NamedVector) {
seedVectors.add((NamedVector) vector);
} else {
seedVectors.add(new NamedVector(vector, seedPathStr + '.' + item++));
}
} else {
throw new IllegalStateException("Bad value class: " + valueClass);
}
}