/** * Check iterator contents for equality (sensitive to order) * * @param set1 iterator to compare * @param set2 iterator to compare * @return true if the iterators have the same content, false otherwise. */ public static boolean equalIterators(Iterator<?> set1, Iterator<?> set2) { while (set1.hasNext() && set2.hasNext()) { Object o1 = set1.next(); Object o2 = set2.next(); if (o1 instanceof Stream && o2 instanceof Stream) { if (!equalStreams((Stream<?>) o1, (Stream<?>) o2)) { return false; } } else { if (!o1.equals(o2)) { return false; } } } return set1.hasNext() == set2.hasNext(); }
/** * Check iterator contents for equality (sensitive to order) * * @param set1 iterator to compare * @param set2 iterator to compare * @return true if the iterators have the same content, false otherwise. */ public static boolean equalIterators(Iterator<?> set1, Iterator<?> set2) { while (set1.hasNext() && set2.hasNext()) { Object o1 = set1.next(); Object o2 = set2.next(); if (o1 instanceof Stream && o2 instanceof Stream) { if (!equalStreams((Stream<?>) o1, (Stream<?>) o2)) { return false; } } else { if (!o1.equals(o2)) { return false; } } } return set1.hasNext() == set2.hasNext(); }
/** * Check iterator contents for equality (sensitive to order) * * @param set1 iterator to compare * @param set2 iterator to compare * @return true if the iterators have the same content, false otherwise. */ public static boolean equalIterators(Iterator<?> set1, Iterator<?> set2) { while (set1.hasNext() && set2.hasNext()) { Object o1 = set1.next(); Object o2 = set2.next(); if (o1 instanceof Stream && o2 instanceof Stream) { if (!equalStreams((Stream<?>) o1, (Stream<?>) o2)) { return false; } } else { if (!o1.equals(o2)) { return false; } } } return set1.hasNext() == set2.hasNext(); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj == null) { return false; } if (!(obj instanceof OWLObject)) { return false; } OWLObject other = (OWLObject) obj; if (typeIndex() != other.typeIndex() || hashCode() != other.hashCode()) { return false; } return equalStreams(components(), other.components()); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj == null) { return false; } if (!(obj instanceof OWLObject)) { return false; } OWLObject other = (OWLObject) obj; if (typeIndex() != other.typeIndex() || hashCode() != other.hashCode()) { return false; } return equalStreams(components(), other.components()); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj == null) { return false; } if (!(obj instanceof OWLObject)) { return false; } OWLObject other = (OWLObject) obj; if (typeIndex() != other.typeIndex() || hashCode() != other.hashCode()) { return false; } return equalStreams(components(), other.components()); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj == null) { return false; } if (!(obj instanceof OWLObject)) { return false; } OWLObject other = (OWLObject) obj; if (typeIndex() != other.typeIndex() || hashCode() != other.hashCode()) { return false; } return equalStreams(components(), other.components()); }
/** * Determines if another axiom is equal to this axiom not taking into * consideration the annotations on the axiom * * @param axiom The axiom to test if equal * @return {@code true} if {@code axiom} without annotations is equal to this axiom without * annotations otherwise {@code false}. */ default boolean equalsIgnoreAnnotations(@Nullable OWLAxiom axiom) { if (axiom == null) { return false; } if (this == axiom) { return true; } if (typeIndex() != axiom.typeIndex()) { return false; } return equalStreams(componentsWithoutAnnotations(), axiom.componentsWithoutAnnotations()); }
/** * Determines if another axiom is equal to this axiom not taking into * consideration the annotations on the axiom * * @param axiom The axiom to test if equal * @return {@code true} if {@code axiom} without annotations is equal to this axiom without * annotations otherwise {@code false}. */ default boolean equalsIgnoreAnnotations(@Nullable OWLAxiom axiom) { if (axiom == null) { return false; } if (this == axiom) { return true; } if (typeIndex() != axiom.typeIndex()) { return false; } return equalStreams(componentsWithoutAnnotations(), axiom.componentsWithoutAnnotations()); }
/** * Determines if another axiom is equal to this axiom not taking into * consideration the annotations on the axiom * * @param axiom The axiom to test if equal * @return {@code true} if {@code axiom} without annotations is equal to this axiom without * annotations otherwise {@code false}. */ default boolean equalsIgnoreAnnotations(@Nullable OWLAxiom axiom) { if (axiom == null) { return false; } if (this == axiom) { return true; } if (typeIndex() != axiom.typeIndex()) { return false; } return equalStreams(componentsWithoutAnnotations(), axiom.componentsWithoutAnnotations()); }