View Javadoc

1   package org.openprovenance.model.collections;
2   
3   import java.util.Collection;
4   import java.util.List;
5   import java.util.Arrays;
6   import java.util.LinkedList;
7   
8   
9   
10  import org.openprovenance.model.ArtifactRef;
11  import org.openprovenance.model.Artifact;
12  import org.openprovenance.model.AccountRef;
13  import org.openprovenance.model.WasDerivedFrom;
14  import org.openprovenance.model.Account;
15  import org.openprovenance.model.OPMFactory;
16  
17  
18  
19  
20  /*** An extended Factory of OPM objects related to Collections.
21      Needs to be moved in a separate module probably, since it is an extension*/
22  
23  public class CollectionFactory  implements CollectionURIs {
24  
25      final private OPMFactory oFactory;
26  
27      public CollectionFactory(OPMFactory oFactory) {
28          this.oFactory=oFactory;
29      }
30     
31  
32  //     public WasDerivedFrom newContained(String id,
33  //                                        ArtifactRef aid1,
34  //                                        ArtifactRef aid2,
35  //                                        Collection<AccountRef> accounts) {
36  //         return oFactory.newWasDerivedFrom(id,aid1,aid2,CONTAINED,accounts);
37  //     }
38  
39      public WasDerivedFrom newContained(String id,
40                                         Artifact a1,
41                                         Artifact a2,
42                                         Collection<Account> accounts) {
43          return oFactory.newWasDerivedFrom(id,a1,a2,CONTAINED,accounts);
44      }
45  
46  
47  //     public WasDerivedFrom newWasIdenticalTo(String id,
48  //                                             ArtifactRef aid1,
49  //                                             ArtifactRef aid2,
50  //                                             Collection<AccountRef> accounts) {
51  //         return oFactory.newWasDerivedFrom(id,aid1,aid2,WASIDENTICALTO,accounts);
52  //     }
53  
54      public WasDerivedFrom newWasIdenticalTo(String id,
55                                              Artifact a1,
56                                              Artifact a2,
57                                              Collection<Account> accounts) {
58          return oFactory.newWasDerivedFrom(id,a1,a2,WASIDENTICALTO,accounts);
59      }
60  
61  
62  
63  
64  
65  }
66