I've got the CommentAnnotations and the TagAnnotations returning from my Java app but I can't seem to get the key/value pairs for the MapAnnotation.
Using OMERO 5.4.0 on Linux Centos 7.
In the following code I've split out each assign to separate lines and used the get(i) function instead of an iterator at present.
The NamedValue: nv_0.getClass.getName() returns omero.model.NamedValue@16c069df
but nv_0.getValue() is not a valid function.
How do I get the value of the current NamedValue, nv_0 ?
Thanks in advance
Derek
- Code: Select all
List mapTypes = new ArrayList();
mapTypes.add("ome.model.annotations.MapAnnotation");
Map <Long,Set<Annotation>> mapSetMap = proxy.loadAnnotations("Image", imageIds, mapTypes, annotatorIds, param);
Iterator mit = mapSetMap.entrySet().iterator();
while (mit.hasNext()) {
Map.Entry pair = (Map.Entry)mit.next();
ArrayList ret = (ArrayList)pair.getValue();
MapAnnotation mapannot = (MapAnnotation)ret.get(0);
List<NamedValue> nv = mapannot.getMapValue();
NamedValue nv_0 = (NamedValue)nv.get(0);
System.out.println("Named Value type: " + nv_0.getClass().getName());
System.out.println("Named Value Value: " + nv_0);
mit.remove();
}