KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > artifact > resolver > ArtifactResolutionResult


1 package org.apache.maven.artifact.resolver;
2
3 /*
4  * Copyright 2001-2005 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import java.util.HashSet JavaDoc;
20 import java.util.Iterator JavaDoc;
21 import java.util.Set JavaDoc;
22
23 /**
24  * @author <a HREF="mailto:jason@maven.org">Jason van Zyl</a>
25  * @version $Id: ArtifactResolutionResult.java 219276 2005-07-16 01:24:13Z jdcasey $
26  */

27 public class ArtifactResolutionResult
28 {
29     private Set JavaDoc resolutionNodes;
30
31     // calculated.
32
private Set JavaDoc artifacts;
33     
34     public ArtifactResolutionResult()
35     {
36     }
37
38     public Set JavaDoc getArtifacts()
39     {
40         if ( artifacts == null )
41         {
42             artifacts = new HashSet JavaDoc();
43             
44             for ( Iterator JavaDoc it = resolutionNodes.iterator(); it.hasNext(); )
45             {
46                 ResolutionNode node = (ResolutionNode) it.next();
47                 artifacts.add( node.getArtifact() );
48             }
49         }
50         
51         return artifacts;
52     }
53     
54     public Set JavaDoc getArtifactResolutionNodes()
55     {
56         return resolutionNodes;
57     }
58
59     public void setArtifactResolutionNodes( Set JavaDoc resolutionNodes )
60     {
61         this.resolutionNodes = resolutionNodes;
62         
63         // clear the cache
64
this.artifacts = null;
65     }
66 }
67
Popular Tags