/** * @see Set#equals */ public override bool Equals(Object obj) { if (obj is java.util.Set <Object> ) { java.util.Set <Object> set = (java.util.Set <Object>)obj; if (set.containsAll(this) && set.size() == this.size()) { return(true); } } return(false); }
/** * Factory method to create an ordered set specifying the list and set to use. * <p> * The list and set must both be empty. * * @param set the set to decorate, must be empty and not null * @param list the list to decorate, must be empty and not null * @throws IllegalArgumentException if set or list is null * @throws IllegalArgumentException if either the set or list is not empty * @since Commons Collections 3.1 */ public static ListOrderedSet decorate(java.util.Set <Object> set, java.util.List <Object> list) { if (set == null) { throw new java.lang.IllegalArgumentException("Set must not be null"); } if (list == null) { throw new java.lang.IllegalArgumentException("List must not be null"); } if (set.size() > 0 || list.size() > 0) { throw new java.lang.IllegalArgumentException("Set and List must be empty"); } return(new ListOrderedSet(set, list)); }
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"); }
/// <summary> /// Execute an updating query. /// </summary> /// <returns>An array containing the root nodes of documents that have been /// updated by the query.</returns> /// <exception cref="DynamicError">Throws a DynamicError if any run-time failure /// occurs while evaluating the expression, or if the expression is not an /// updating query.</exception> public XdmNode[] RunUpdate() { if (!exp.isUpdateQuery()) { throw new DynamicError("Not an updating query"); } try { java.util.Set updatedDocs = exp.runUpdate(context); XdmNode[] result = new XdmNode[updatedDocs.size()]; int i = 0; for (java.util.Iterator iter = updatedDocs.iterator(); iter.hasNext();) { result[i++] = (XdmNode)XdmValue.Wrap((NodeInfo)iter.next()); } return(result); } catch (JXPathException err) { throw new DynamicError(err); } }
public override bool Equals(object @object) { if (this == @object) { return(true); } if (@object is java.util.Set <E> ) { java.util.Set <E> s = (java.util.Set <E>)@object; try { return(size() == s.size() && containsAll(s)); } catch (System.ArgumentNullException) { return(false); } catch (System.InvalidCastException) { return(false); } } return(false); }