@Override public boolean match(SimplePhysicalEntity a, SimplePhysicalEntity b) { return !a.equals(b) && a.getEntityReference() != null && !a.getName().isEmpty() && !b.getName().isEmpty() && !a.getEntityReference().isEquivalent(b.getEntityReference()) && !BiopaxValidatorUtils.namesInCommon(a, b).isEmpty(); } };
boolean sameKindEntityExists(SimplePhysicalEntity spe, Set<SimplePhysicalEntity> side) { assert !(spe instanceof SmallMolecule); boolean ret = false; for (SimplePhysicalEntity value : side) { if (!(value instanceof SmallMolecule)) { if(value.getEntityReference() != null && value.getEntityReference().isEquivalent(spe.getEntityReference())) return true; } } return ret; }
@Override public boolean match(SimplePhysicalEntity a, SimplePhysicalEntity b) { return !a.equals(b) && a.getEntityReference() != null && !a.getName().isEmpty() && !b.getName().isEmpty() && !a.getEntityReference().isEquivalent(b.getEntityReference()) && CollectionUtils.containsAny(a.getName(), b.getName()); } };
boolean sameKindEntityExists(SimplePhysicalEntity spe, Set<PhysicalEntity> side) { assert !(spe instanceof SmallMolecule); boolean ret = false; for (PhysicalEntity value : side) { if (value instanceof SimplePhysicalEntity) { SimplePhysicalEntity that = (SimplePhysicalEntity) value; if( !(value instanceof SmallMolecule) && that.getEntityReference() != null && that.getEntityReference().isEquivalent(spe.getEntityReference())) return true; } else { // Complex if(sameKindEntityExists(spe, ((Complex)value).getComponent())) return true; } //still false - check member PEs as well ;) if(sameKindEntityExists(spe, value.getMemberPhysicalEntity())) return true; } return ret; }
? ((SimplePhysicalEntity)righty).getEntityReference() == null : ((SimplePhysicalEntity)lefty).getEntityReference() .isEquivalent(((SimplePhysicalEntity)righty).getEntityReference()) );
? ((SimplePhysicalEntity)righty).getEntityReference() == null : ((SimplePhysicalEntity)lefty).getEntityReference() .isEquivalent(((SimplePhysicalEntity)righty).getEntityReference()) );