/** * Indicates if the collection has any addresses that meet the minimum trust status. * @param minTrustStatus The minimum trust status. * @return True if the collection contains any addresses that eet the minimum trust status. False otherwise. */ public boolean isTrusted(TrustEnforcementStatus minTrustStatus) { for (NHINDAddress add : this) if (!add.isTrusted(minTrustStatus)) return false; return true; }
/** * Gets all addresses in the collection that meet the minimum trust status. * @param minTrustStatus The minimum trust status. * @return All addresses in the collection that are trusted. */ public Collection<NHINDAddress> getTrusted(TrustEnforcementStatus minTrustStatus) { Collection<NHINDAddress> adds = new ArrayList<NHINDAddress>(); for (NHINDAddress add : this) if (add.isTrusted(minTrustStatus)) adds.add(add); return adds; }
/** * Gets all addresses in the collection that do not meet the minimum trust status. * @param minTrustStatus The minimum trust status. * @return All addresses in the collection that are not trusted. */ public Collection<NHINDAddress> getUntrusted(TrustEnforcementStatus minTrustStatus) { Collection<NHINDAddress> adds = new ArrayList<NHINDAddress>(); for (NHINDAddress add : this) if (!add.isTrusted(minTrustStatus)) adds.add(add); return adds; }
/** * Removes all addresses from the collection that do not meet the minimum trust status. */ public void removeUntrusted(TrustEnforcementStatus minTrustStatus) { // Remove anybody who is not trusted for (int i = this.size() - 1; i >=0; --i) if (!this.get(i).isTrusted(minTrustStatus)) this.remove(i); }