public Accounts union (Accounts g1, Accounts g2) { Accounts res=of.newAccounts(null,null); if (g1.getAccount()!=null) { res.getAccount().addAll(g1.getAccount()); } if (g2.getAccount()!=null) { res.getAccount().addAll(g2.getAccount()); } if (g1.getOverlaps()!=null) { res.getOverlaps().addAll(g1.getOverlaps()); } if (g2.getOverlaps()!=null) { res.getOverlaps().addAll(g2.getOverlaps()); } return res; }
/** * Create an instance of {@link Accounts } * */ public Accounts createAccounts() { return new Accounts(); }
public boolean equals(Object object) { if (!(object instanceof Accounts)) { return false; } if (this == object) { return true; } final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder(); equals(object, equalsBuilder); return equalsBuilder.isEquals(); }
public Account addAccount(String name, Account account) { Account existing=accountMap.get(name); if (existing!=null) { return existing; } else { accountMap.put(name,account); Accounts accounts=getAccounts(); if (accounts==null) { accounts=of.createAccounts(); setAccounts(accounts); } accounts.getAccount().add(account); return account; } } public Account addAccount(Account account) {
public String toString() { final ToStringBuilder toStringBuilder = new JAXBToStringBuilder(this); toString(toStringBuilder); return toStringBuilder.toString(); }
public int hashCode() { final HashCodeBuilder hashCodeBuilder = new JAXBHashCodeBuilder(); hashCode(hashCodeBuilder); return hashCodeBuilder.toHashCode(); }
logger.warn("this graph contains no accounts -- using only the default"); } else { for (Account acc:accounts.getAccount()) {
public void toString(ToStringBuilder toStringBuilder) { { List<Account> theAccount; theAccount = this.getAccount(); toStringBuilder.append("account", theAccount); } { List<Overlaps> theOverlaps; theOverlaps = this.getOverlaps(); toStringBuilder.append("overlaps", theOverlaps); } }
for (Account acc: gr.getAccounts().getAccount()) { accs.add(register(acc.getId(),newAccount(acc)));
public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof Accounts)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } final Accounts that = ((Accounts) object); equalsBuilder.append(this.getAccount(), that.getAccount()); equalsBuilder.append(this.getOverlaps(), that.getOverlaps()); }
graph.getAccounts().getAccount().add(accountTable.get(name));
public void hashCode(HashCodeBuilder hashCodeBuilder) { hashCodeBuilder.append(this.getAccount()); hashCodeBuilder.append(this.getOverlaps()); }
for (Account acc: graph.getAccounts().getAccount()) { Resource res=Resource.resource(urify(acc.getId())); ProvenanceAccount rdfAccount=pcf.newAccount(acc.getId(),res);
public Accounts newAccounts(Collection<Account> accs, Collection<Overlaps> ovlps) { Accounts res=of.createAccounts(); if (accs!=null) { res.getAccount().addAll(accs); } if (ovlps!=null) { res.getOverlaps().addAll(ovlps); } return res; }
for (Account acc: graph.getAccounts().getAccount()) { Resource res=Resource.resource(urify(acc.getId())); ProvenanceAccount rdfAccount=pcf.newAccount(acc.getId(),res);
public void updateFromRdfGraph(OPMGraph graph) { IndexedOPMGraph igraph=new IndexedOPMGraph(oFactory,graph); List<Account> accs=graph.getAccounts().getAccount(); for (Account acc: accs) { if (acc.getId().equals("_null")) { accs.remove(acc); break; } } Collection<Account> green=Collections.singleton(igraph.getAccount("green")); Collection<Account> orange=Collections.singleton(igraph.getAccount("orange")); List<Account> green_orange=new LinkedList(); green_orange.addAll(green); green_orange.addAll(orange); Overlaps ov1=oFactory.newOverlaps(green_orange); graph.getAccounts().getOverlaps().add(ov1); }
graph.getAccounts().getAccount().add(accountTable.get(name));
if (accs!=null) { Accounts aaccs=of.createAccounts(); aaccs.getAccount().addAll(accs); if (ops!=null) aaccs.getOverlaps().addAll(ops); res.setAccounts(aaccs);
this.of=oFactory.getObjectFactory(); if (graph.getAccounts()!=null) { for (Account acc: graph.getAccounts().getAccount()) { addAccount(acc);
public void sortGraph(OPMGraph graph) { graph.setAnnotations(oFactory.getObjectFactory().createAnnotations()); sortById((List)graph.getAccounts().getAccount()); if (graph.getProcesses()!=null && graph.getProcesses().getProcess()!=null) { sortById((List)graph.getProcesses().getProcess()); for (Process p: graph.getProcesses().getProcess()) { sortAnnotations(p.getAnnotation()); sortByRef(p.getAccount()); } } if (graph.getArtifacts()!=null && graph.getArtifacts().getArtifact()!=null) { sortById((List)graph.getArtifacts().getArtifact()); for (Artifact a: graph.getArtifacts().getArtifact()) { sortAnnotations(a.getAnnotation()); sortByRef(a.getAccount()); } } if (graph.getAgents()!=null && graph.getAgents().getAgent()!=null) { sortById((List)graph.getAgents().getAgent()); for (Agent a: graph.getAgents().getAgent()) { sortAnnotations(a.getAnnotation()); sortByRef(a.getAccount()); } } for (Object e: graph.getDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy()) { sortAnnotations(((Edge)e).getAnnotation()); sortByRef(((Edge)e).getAccount()); } sortEdges(graph.getDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy()); }