/** * Checks if an filename already has been added to the result list * @param filename the filename to check * @return true, if this filename already has been added */ protected internal bool hasBeenAdded(String filename) { if (addedFromChangeSetList.contains(filename) || addedFromStreamList.contains(filename)) { return(true); } return(false); }
//----------------------------------------------------------------------- /** * Returns a new list containing all elements that are contained in * both given lists. * * @param list1 the first list * @param list2 the second list * @return the intersection of those two lists * @throws NullPointerException if either list is null */ public static java.util.List <Object> intersection(java.util.List <Object> list1, java.util.List <Object> list2) { java.util.ArrayList <Object> result = new java.util.ArrayList <Object>(); java.util.Iterator <Object> iterator = list2.iterator(); while (iterator.hasNext()) { Object o = iterator.next(); if (list1.contains(o)) { result.add(o); } } return(result); }
private void assertCDvOrdinal(org.openehr.am.archetype.constraintmodel.ArchetypeConstraint node, String terminoloy, String[] codes, org.openehr.am.openehrprofile.datatypes.quantity.Ordinal assumedValue) { Assert.IsTrue(node is org.openehr.am.openehrprofile.datatypes.quantity.CDvOrdinal, "CDvOrdinal expected"); org.openehr.am.openehrprofile.datatypes.quantity.CDvOrdinal cordinal = (org.openehr.am.openehrprofile.datatypes.quantity.CDvOrdinal)node; java.util.List codeList = java.util.Arrays.asList(codes); java.util.Set list = cordinal.getList(); Assert.AreEqual(codes.Length, list.size(), "codes.size"); for (java.util.Iterator it = list.iterator(); it.hasNext();) { org.openehr.am.openehrprofile.datatypes.quantity.Ordinal ordinal = (org.openehr.am.openehrprofile.datatypes.quantity.Ordinal)it.next(); Assert.AreEqual("local", ordinal.getSymbol().getTerminologyId().getValue(), "terminology"); Assert.IsTrue(codeList.contains(ordinal.getSymbol().getCodeString()), "code missing"); } Assert.AreEqual(assumedValue, cordinal.getAssumedValue(), "assumedValue wrong"); }