private Role synchronizeRole( Role role ) { Key key = new Key("role:"+role.getName()); if (synched.containsKey(key)) { return (Role) synched.get(key); } synched.put(key, role); return role; }
private Role synchronizeRole( Role role ) { Key key = new Key("role:"+role.getName()); if (synched.containsKey(key)) { return (Role) synched.get(key); } synched.put(key, role); return role; }
protected Key keyForAnnotatedObject(AnnotatedObject annotatedObject) { Class normalizedClass = CgLibUtil.removeCglibEnhanced(annotatedObject.getClass()); return new Key(normalizedClass.getSimpleName() + ":" + annotatedObject.getShortLabel()); }
protected Key keyForAnnotatedObject(AnnotatedObject annotatedObject) { Class normalizedClass = CgLibUtil.removeCglibEnhanced(annotatedObject.getClass()); return new Key(normalizedClass.getSimpleName() + ":" + annotatedObject.getShortLabel()); }
protected Key keyForInteraction(Interaction interaction) { final Key key = new Key(new CrcCalculator().crc64(interaction)); // pre-calculate the keys for the components here and put them in a map int n = 0; for (Component component : interaction.getComponents()) { Key compKey = new Key(key.getUniqueString() + ":" + component.getShortLabel() + "[" + n + "]"); keyCache.put(Component.class.getSimpleName() + ":" + System.identityHashCode(component), compKey); n++; } return key; }
protected Key keyForBioSource(BioSource bioSource) { StringBuilder sb = new StringBuilder(256); sb.append("BioSource:").append(bioSource.getTaxId()); if (bioSource.getCvCellType() != null) { sb.append("|").append(bioSource.getCvCellType().getIdentifier()); } if (bioSource.getCvTissue() != null) { sb.append("|").append(bioSource.getCvTissue().getIdentifier()); } return new Key(sb.toString()); }
protected Key keyForInteraction(Interaction interaction) { final Key key = new Key(new CrcCalculator().crc64(interaction)); // pre-calculate the keys for the components here and put them in a map int n = 0; for (Component component : interaction.getComponents()) { Key compKey = new Key(key.getUniqueString() + ":" + component.getShortLabel() + "[" + n + "]"); keyCache.put(Component.class.getSimpleName() + ":" + System.identityHashCode(component), compKey); n++; } return key; }
protected Key keyForInteractor(Interactor interactor) { final Collection<InteractorXref> interactorXrefs = XrefUtils.getIdentityXrefs(interactor); Key key; if (interactorXrefs.isEmpty()) { key = keyForAnnotatedObject(interactor); } else { Class normalizedClass = CgLibUtil.removeCglibEnhanced(interactor.getClass()); key = new Key(normalizedClass.getSimpleName() + ":" + concatPrimaryIds(interactorXrefs)); } return key; }
protected Key keyForInteractor(Interactor interactor) { final Collection<InteractorXref> interactorXrefs = XrefUtils.getIdentityXrefs(interactor); Key key; if (interactorXrefs.isEmpty()) { key = keyForAnnotatedObject(interactor); } else { Class normalizedClass = CgLibUtil.removeCglibEnhanced(interactor.getClass()); key = new Key(normalizedClass.getSimpleName() + ":" + concatPrimaryIds(interactorXrefs)); } return key; }
protected Key keyForBioSource(BioSource bioSource) { StringBuilder sb = new StringBuilder(256); sb.append("BioSource:").append(bioSource.getTaxId()); if (bioSource.getCvCellType() != null) { sb.append("|").append(bioSource.getCvCellType().getIdentifier()); } if (bioSource.getCvTissue() != null) { sb.append("|").append(bioSource.getCvTissue().getIdentifier()); } return new Key(sb.toString()); }
protected Key keyForInstitution(Institution institution) { final Collection<InstitutionXref> institutionXrefs = XrefUtils.getIdentityXrefs(institution); Key key; if (institutionXrefs.isEmpty()) { key = keyForAnnotatedObject(institution); } else { key = new Key("Institution:" + concatPrimaryIds(institutionXrefs)); } return key; }
protected Key keyForInstitution(Institution institution) { final Collection<InstitutionXref> institutionXrefs = XrefUtils.getIdentityXrefs(institution); Key key; if (institutionXrefs.isEmpty()) { key = keyForAnnotatedObject(institution); } else { key = new Key("Institution:" + concatPrimaryIds(institutionXrefs)); } return key; }
protected Key keyForCvObject(CvObject cvObject) { String key = cvObject.getIdentifier(); if (key == null) { // search for identity final Collection<CvObjectXref> xrefs = XrefUtils.getIdentityXrefs(cvObject); if (!xrefs.isEmpty()) { key = concatPrimaryIds(xrefs); } else { key = cvObject.getShortLabel(); } } key = cvObject.getClass().getSimpleName() + "__" + key; return new Key(key); }
protected Key keyForExperiment(Experiment experiment) { return new Key(new ExperimentKeyCalculator().calculateExperimentKey(experiment)); }
public Key keyForXref(Xref xref) { return new Key(keyFor(xref.getParent()).getUniqueString() + "::" + xref.getPrimaryId()); }
public Key keyForAnnotation(Annotation annotation, AnnotatedObject parent) { return new Key(keyFor(parent).getUniqueString() + "::" + annotation.getCvTopic() + "_" + annotation.getAnnotationText()); }
public Key keyForXref(Xref xref) { return new Key(keyFor(xref.getParent()).getUniqueString() + "::" + xref.getPrimaryId()); }
public Key keyForAnnotation(Annotation annotation, AnnotatedObject parent) { return new Key(keyFor(parent).getUniqueString() + "::" + annotation.getCvTopic() + "_" + annotation.getAnnotationText()); }
protected Key keyForFeature(Feature feature) { if (feature.getComponent() == null) { throw new IllegalArgumentException("Cannot create a feature key for feature without component: " + feature); } Key componentKey = keyFor(feature.getComponent()); return new Key(new FeatureKeyCalculator().calculateFeatureKey(feature) + "___" + componentKey.getUniqueString()); // return new Key( keyForAnnotatedObject( feature ).getUniqueString() + "___" + componentKey.getUniqueString() ); }
protected Key keyForFeature(Feature feature) { if (feature.getComponent() == null) { throw new IllegalArgumentException("Cannot create a feature key for feature without component: " + feature); } Key componentKey = keyFor(feature.getComponent()); return new Key(new FeatureKeyCalculator().calculateFeatureKey(feature) + "___" + componentKey.getUniqueString()); // return new Key( keyForAnnotatedObject( feature ).getUniqueString() + "___" + componentKey.getUniqueString() ); }