1 32 33 package com.jeantessier.dependency; 34 35 import java.util.*; 36 37 public class AndCompositeSelectionCriteria extends CompositeSelectionCriteria { 38 public AndCompositeSelectionCriteria(Collection subcriteria) { 39 super(subcriteria); 40 } 41 42 public boolean isMatchingPackages() { 43 boolean result = true; 44 45 Iterator i = getSubcriteria().iterator(); 46 while (result && i.hasNext()) { 47 result = ((SelectionCriteria) i.next()).isMatchingPackages(); 48 } 49 50 return result; 51 } 52 53 public boolean isMatchingClasses() { 54 boolean result = true; 55 56 Iterator i = getSubcriteria().iterator(); 57 while (result && i.hasNext()) { 58 result = ((SelectionCriteria) i.next()).isMatchingClasses(); 59 } 60 61 return result; 62 } 63 64 public boolean isMatchingFeatures() { 65 boolean result = true; 66 67 Iterator i = getSubcriteria().iterator(); 68 while (result && i.hasNext()) { 69 result = ((SelectionCriteria) i.next()).isMatchingFeatures(); 70 } 71 72 return result; 73 } 74 75 public boolean matches(PackageNode node) { 76 boolean result = true; 77 78 Iterator i = getSubcriteria().iterator(); 79 while (result && i.hasNext()) { 80 result = ((SelectionCriteria) i.next()).matches(node); 81 } 82 83 return result; 84 } 85 86 public boolean matches(ClassNode node) { 87 boolean result = true; 88 89 Iterator i = getSubcriteria().iterator(); 90 while (result && i.hasNext()) { 91 result = ((SelectionCriteria) i.next()).matches(node); 92 } 93 94 return result; 95 } 96 97 public boolean matches(FeatureNode node) { 98 boolean result = true; 99 100 Iterator i = getSubcriteria().iterator(); 101 while (result && i.hasNext()) { 102 result = ((SelectionCriteria) i.next()).matches(node); 103 } 104 105 return result; 106 } 107 108 public boolean matchesPackageName(String name) { 109 boolean result = true; 110 111 Iterator i = getSubcriteria().iterator(); 112 while (result && i.hasNext()) { 113 result = ((SelectionCriteria) i.next()).matchesPackageName(name); 114 } 115 116 return result; 117 } 118 119 public boolean matchesClassName(String name) { 120 boolean result = true; 121 122 Iterator i = getSubcriteria().iterator(); 123 while (result && i.hasNext()) { 124 result = ((SelectionCriteria) i.next()).matchesClassName(name); 125 } 126 127 return result; 128 } 129 130 public boolean matchesFeatureName(String name) { 131 boolean result = true; 132 133 Iterator i = getSubcriteria().iterator(); 134 while (result && i.hasNext()) { 135 result = ((SelectionCriteria) i.next()).matchesFeatureName(name); 136 } 137 138 return result; 139 } 140 } 141 | Popular Tags |