Map<Integer,List<WeightedVectorWritable>> clusterIdToPoints = getClusterIdToPoints();
List<WeightedVectorWritable> points = clusterIdToPoints.get(clusterWritable.getValue().getId());
if (points != null) {
writer.write("\tWeight : [props - optional]: Point:\n\t");
for (Iterator<WeightedVectorWritable> iterator = points.iterator(); iterator.hasNext();) {
WeightedVectorWritable point = iterator.next();
writer.write(String.valueOf(point.getWeight()));
if (point instanceof WeightedPropertyVectorWritable) {
WeightedPropertyVectorWritable tmp = (WeightedPropertyVectorWritable) point;
Map<Text,Text> map = tmp.getProperties();
// map can be null since empty maps when written are returned as null
writer.write(" : [");
if (map != null) {
for (Map.Entry<Text,Text> entry : map.entrySet()) {
writer.write(entry.getKey().toString());
writer.write("=");
writer.write(entry.getValue().toString());
}
}
writer.write("]");
}
writer.write(": ");
writer.write(AbstractCluster.formatVector(point.getVector(), dictionary));
if (iterator.hasNext()) {
writer.write("\n\t");
}
}
writer.write('\n');