public int compare(Object o1, Object o2) { EmbeddedAnnotation a1=(EmbeddedAnnotation) o1; EmbeddedAnnotation a2=(EmbeddedAnnotation) o2; if (a1.getId()==null) { if (a2.getId()==null) { return a1.getClass().getName().compareTo(a2.getClass().getName()); } else { return -1; } } else { if (a2.getId()==null) { return +1; } else { return a1.getId().compareTo(a2.getId()); } } }}); }
public int compare(Object o1, Object o2) { JAXBElement j1=(JAXBElement) o1; JAXBElement j2=(JAXBElement) o2; EmbeddedAnnotation a1=(EmbeddedAnnotation) j1.getValue(); EmbeddedAnnotation a2=(EmbeddedAnnotation) j2.getValue(); if (a1.getId()==null) { if (a2.getId()==null) { return a1.getClass().getName().compareTo(a2.getClass().getName()); } else { return -1; } } else { if (a2.getId()==null) { return +1; } else { return a1.getId().compareTo(a2.getId()); } } }}); for (JAXBElement je: ll) {
public void hashCode(HashCodeBuilder hashCodeBuilder) { hashCodeBuilder.append(this.getProperty()); hashCodeBuilder.append(this.getAccount()); hashCodeBuilder.append(this.getAnnotation()); hashCodeBuilder.append(this.getId()); }
public void addNewAnnotations(Annotable res, List<JAXBElement<? extends org.openprovenance.model.EmbeddedAnnotation>> anns) { for (JAXBElement<? extends org.openprovenance.model.EmbeddedAnnotation> ann: anns) { EmbeddedAnnotation ea=ann.getValue(); if (ea.getId()!=null) addAnnotation(res,newEmbeddedAnnotation(ea.getId(), ea.getProperty(), ea.getAccount(), null)); } }
public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof EmbeddedAnnotation)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } final EmbeddedAnnotation that = ((EmbeddedAnnotation) object); equalsBuilder.append(this.getProperty(), that.getProperty()); equalsBuilder.append(this.getAccount(), that.getAccount()); equalsBuilder.append(this.getAnnotation(), that.getAnnotation()); equalsBuilder.append(this.getId(), that.getId()); }
public void toString(ToStringBuilder toStringBuilder) { { List<Property> theProperty; theProperty = this.getProperty(); toStringBuilder.append("property", theProperty); } { List<AccountRef> theAccount; theAccount = this.getAccount(); toStringBuilder.append("account", theAccount); } { List<JAXBElement<? extends EmbeddedAnnotation>> theAnnotation; theAnnotation = this.getAnnotation(); toStringBuilder.append("annotation", theAnnotation); } { String theId; theId = this.getId(); toStringBuilder.append("id", theId); } }
public void emitAnnotation(String id, EmbeddedAnnotation ann, PrintStream out) { HashMap<String,String> properties=new HashMap(); String newId=annotationId(ann.getId(),id); emitNode(newId, addAnnotationShape(ann,addAnnotationColor(ann,addAnnotationLabel(ann,properties))), out); HashMap<String,String> linkProperties=new HashMap(); emitEdge(newId,id,addAnnotationLinkProperties(ann,linkProperties),out,true); }
if (prop.getKey().equals(LABEL_PROPERTY)) { Label label=newLabel((String)prop.getValue()); setIdForCompactAnnotation(label,ann.getId()); return of.createLabel(label); setIdForCompactAnnotation(type,ann.getId()); return of.createType(type); setIdForCompactAnnotation(profile,ann.getId()); return of.createProfile(profile); setIdForCompactAnnotation(pname,ann.getId()); return of.createPname(pname); Value value=newValue(properties.get(0).getValue(), (String)properties.get(1).getValue()); setIdForCompactAnnotation(value,ann.getId()); return of.createValue(value); } else if ((properties.get(1).getKey().equals(VALUE_PROPERTY)) Value value=newValue(properties.get(1).getValue(), (String)properties.get(0).getValue()); setIdForCompactAnnotation(value,ann.getId()); return of.createValue(value);
public void addNewAnnotations(Annotable res, List<JAXBElement<? extends org.openprovenance.model.EmbeddedAnnotation>> anns) { for (JAXBElement<? extends org.openprovenance.model.EmbeddedAnnotation> ann: anns) { EmbeddedAnnotation ea=ann.getValue(); String label=getLabel(ea); if (label!=null) addAnnotation(res,newLabel(label)); String type=getType(ea); if (type!=null) addAnnotation(res,newType(type)); String profile=getProfile(ea); if (profile!=null) addAnnotation(res,newProfile(profile)); String pname=getPname(ea); if (pname!=null) addAnnotation(res,newPName(pname)); Object value=getValue(ea); if (value!=null) addAnnotation(res,newValue(value,getEncoding(ea))); if (ea.getId()!=null) addAnnotation(res,newEmbeddedAnnotation(ea.getId(), ea.getProperty(), newAccounts(ea.getAccount()), null)); } }