private <A extends Alias> Collection<A> subtractAliases( Collection<A> sourceCol, Collection<A> targetCol ) { Collection<A> aliases = new ArrayList<A>( Math.max( sourceCol.size(), targetCol.size() ) ); for ( A source : sourceCol ) { boolean found = false; for ( Iterator<A> iterator = targetCol.iterator(); iterator.hasNext() && !found; ) { A target = iterator.next(); if ( EqualsUtils.sameAlias( source, target ) ) { // found it, we do not copy if to the resulting collection found = true; } } if ( !found ) { aliases.add( source ); } } return aliases; }
private Collection<Annotation> subtractAnnotations( Collection<Annotation> sourceCol, Collection<Annotation> targetCol ) { Collection<Annotation> annotations = new ArrayList<Annotation>( Math.max( sourceCol.size(), targetCol.size() ) ); for ( Annotation source : sourceCol ) { boolean found = false; for ( Iterator<Annotation> iterator = targetCol.iterator(); iterator.hasNext() && !found; ) { Annotation target = iterator.next(); if ( EqualsUtils.sameAnnotation( source, target ) ) { // found it, we do not copy if to the resulting collection found = true; } } if ( !found ) { annotations.add( source ); } } return annotations; }
private <X extends Xref> Collection<X> subtractXrefs( Collection<X> sourceCol, Collection<X> targetCol ) { Collection<X> xrefs = new ArrayList<X>( Math.max( sourceCol.size(), targetCol.size() ) ); for ( X source : sourceCol ) { boolean found = false; for ( Iterator<X> iterator = targetCol.iterator(); iterator.hasNext() && !found; ) { X target = iterator.next(); if ( EqualsUtils.sameXref( source, target ) ) { // found it, we do not copy if to the resulting collection found = true; } } if ( !found ) { xrefs.add( source ); } } return xrefs; }
Xref sourceXref = ( Xref ) itXrefSrc.next(); if( EqualsUtils.sameXref( sourceXref, targetXref ) ) { Alias sourceAlias = ( Alias ) itAliasSrc.next(); if( EqualsUtils.sameAlias( sourceAlias, targetAlias ) ) { Annotation sourceAnnot = ( Annotation ) itAnnotSrc.next(); if( EqualsUtils.sameAnnotation( sourceAnnot, targetAnnot ) ) {
public static boolean sameXref( Xref x1, Xref x2 ) { if (x1.getAc() != null && x2.getAc() != null) { return x1.getAc().equals(x2.getAc()); } if ( !same( x1.getPrimaryId(), x2.getPrimaryId() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvDatabase(), x2.getCvDatabase() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvXrefQualifier(), x2.getCvXrefQualifier() ) ) { return false; } if ( !same( x1.getSecondaryId(), x2.getSecondaryId() ) ) { return false; } if ( !same( x1.getDbRelease(), x2.getDbRelease() ) ) { return false; } return true; }
Xref sourceXref = ( Xref ) itXrefSrc.next(); if( EqualsUtils.sameXref( sourceXref, targetXref ) ) { Alias sourceAlias = ( Alias ) itAliasSrc.next(); if( EqualsUtils.sameAlias( sourceAlias, targetAlias ) ) { Annotation sourceAnnot = ( Annotation ) itAnnotSrc.next(); if( EqualsUtils.sameAnnotation( sourceAnnot, targetAnnot ) ) {
public static boolean sameAlias( Alias a1, Alias a2 ) { if (a1.getAc() != null && a2.getAc() != null) { return a1.getAc().equals(a2.getAc()); } if ( !same( a1.getName(), a2.getName() ) ) { return false; } if ( !CvObjectUtils.areEqual( a1.getCvAliasType(), a2.getCvAliasType() ) ) { return false; } return true; }
public static boolean sameXref( Xref x1, Xref x2 ) { if (x1.getAc() != null && x2.getAc() != null) { return x1.getAc().equals(x2.getAc()); } if ( !same( x1.getPrimaryId(), x2.getPrimaryId() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvDatabase(), x2.getCvDatabase() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvXrefQualifier(), x2.getCvXrefQualifier() ) ) { return false; } if ( !same( x1.getSecondaryId(), x2.getSecondaryId() ) ) { return false; } if ( !same( x1.getDbRelease(), x2.getDbRelease() ) ) { return false; } return true; }
private Collection<Annotation> subtractAnnotations( Collection<Annotation> sourceCol, Collection<Annotation> targetCol ) { Collection<Annotation> annotations = new ArrayList<Annotation>( Math.max( sourceCol.size(), targetCol.size() ) ); for ( Annotation source : sourceCol ) { boolean found = false; for ( Iterator<Annotation> iterator = targetCol.iterator(); iterator.hasNext() && !found; ) { Annotation target = iterator.next(); if ( EqualsUtils.sameAnnotation( source, target ) ) { // found it, we do not copy if to the resulting collection found = true; } } if ( !found ) { annotations.add( source ); } } return annotations; }
private <X extends Xref> Collection<X> subtractXrefs( Collection<X> sourceCol, Collection<X> targetCol ) { Collection<X> xrefs = new ArrayList<X>( Math.max( sourceCol.size(), targetCol.size() ) ); for ( X source : sourceCol ) { boolean found = false; for ( Iterator<X> iterator = targetCol.iterator(); iterator.hasNext() && !found; ) { X target = iterator.next(); if ( EqualsUtils.sameXref( source, target ) ) { // found it, we do not copy if to the resulting collection found = true; } } if ( !found ) { xrefs.add( source ); } } return xrefs; }
private <A extends Alias> Collection<A> subtractAliases( Collection<A> sourceCol, Collection<A> targetCol ) { Collection<A> aliases = new ArrayList<A>( Math.max( sourceCol.size(), targetCol.size() ) ); for ( A source : sourceCol ) { boolean found = false; for ( Iterator<A> iterator = targetCol.iterator(); iterator.hasNext() && !found; ) { A target = iterator.next(); if ( EqualsUtils.sameAlias( source, target ) ) { // found it, we do not copy if to the resulting collection found = true; } } if ( !found ) { aliases.add( source ); } } return aliases; }
public static boolean sameAlias( Alias a1, Alias a2 ) { if (a1.getAc() != null && a2.getAc() != null) { return a1.getAc().equals(a2.getAc()); } if ( !same( a1.getName(), a2.getName() ) ) { return false; } if ( !CvObjectUtils.areEqual( a1.getCvAliasType(), a2.getCvAliasType() ) ) { return false; } return true; }
public static boolean sameAnnotation( Annotation a1, Annotation a2 ) { if (a1.getAc() != null && a2.getAc() != null) { return a1.getAc().equals(a2.getAc()); } if ( !same( a1.getAnnotationText(), a2.getAnnotationText() ) ) { return false; } if ( !CvObjectUtils.areEqual( a1.getCvTopic(), a2.getCvTopic() ) ) { return false; } return true; }
public static boolean sameAnnotation( Annotation a1, Annotation a2 ) { if (a1.getAc() != null && a2.getAc() != null) { return a1.getAc().equals(a2.getAc()); } if ( !same( a1.getAnnotationText(), a2.getAnnotationText() ) ) { return false; } if ( !CvObjectUtils.areEqual( a1.getCvTopic(), a2.getCvTopic() ) ) { return false; } return true; }