Revision 40487 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/main/java/org/gvsig/installer/lib/impl/DefaultDependencies.java

View differences:

DefaultDependencies.java
7 7
import org.gvsig.installer.lib.api.Dependencies;
8 8
import org.gvsig.installer.lib.api.Dependency;
9 9
import org.gvsig.installer.lib.api.Version;
10
import org.gvsig.tools.packageutils.StringWithAlias;
10 11

  
11 12
public class DefaultDependencies extends ArrayList implements
12 13
		Dependencies {
......
111 112
	        return resp;
112 113
	    }
113 114

  
115
		public boolean match(String type, StringWithAlias code, Version version) {
116
			Iterator<Dependency> it = this.iterator();
117
			while (it.hasNext()) {
118
				Dependency dependency = it.next();
119
				if (dependency.match(type, code, version)) {
120
					return true;
121
				}
122
			}
123
			return false;
124
		}
125

  
126
		public Dependency find(String type, StringWithAlias code, Version version) {
127
			Iterator<Dependency> it = this.iterator();
128
			while (it.hasNext()) {
129
				Dependency dependency = it.next();
130
				if (dependency.match(type, code, version)) {
131
					return dependency;
132
				}
133
			}
134
			return null;
135
		}
136
		
137
	   public List findAll(String type, StringWithAlias code, Version version) {
138
		       
139
		       List<Dependency> resp = null;
140
		        Iterator<Dependency> it = this.iterator();
141
		        while (it.hasNext()) {
142
		            Dependency dependency = it.next();
143
		            if (dependency.match(type, code, version)) {
144
		                if (resp == null) {
145
		                    resp = new ArrayList<Dependency>();
146
		                }
147
		                resp.add(dependency);
148
		            }
149
		        }
150
		        return resp;
151
		    }
152

  
153

  
154
	   
155
	   
114 156
}

Also available in: Unified diff