uk.ac.ebi.intact.model.Alias.getCvAliasType()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中uk.ac.ebi.intact.model.Alias.getCvAliasType()方法的一些代码示例,展示了Alias.getCvAliasType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Alias.getCvAliasType()方法的具体详情如下:
包路径:uk.ac.ebi.intact.model.Alias
类名称:Alias
方法名:getCvAliasType

Alias.getCvAliasType介绍

暂无

代码示例

代码示例来源:origin: uk.ac.ebi.intact/intact-core

private static boolean isAliasSearchable( Alias alias ) {
    return alias.getCvAliasType() != null;
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

public static Collection<Alias> getAliasByType(AnnotatedObject<?, ?> annotatedObject, String miOrLabel) {
  Collection<Alias> matchingAliases = new ArrayList<Alias>();
  for (Alias alias : annotatedObject.getAliases()) {
    if (alias.getCvAliasType() != null
        && (
        alias.getCvAliasType().getIdentifier().equals(miOrLabel)
            ||
            alias.getCvAliasType().getShortLabel().equals(miOrLabel))
        ) {
      matchingAliases.add(alias);
    }
  }
  return matchingAliases;
}

代码示例来源:origin: uk.ac.ebi.intact.dbupdate/intact-update-model

public UpdatedAlias(Alias alias, UpdateStatus status){
  super();
  if (alias != null){
    type = alias.getCvAliasType() != null ? alias.getCvAliasType().getAc() : null;
    this.name = alias.getName();
  }
  else {
    this.type = null;
    this.name = null;
  }
  this.status = status != null ? status : UpdateStatus.none;
  this.parent = null;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

public static Collection<Alias> getAliasByType(AnnotatedObject<?, ?> annotatedObject, String miOrLabel) {
  Collection<Alias> matchingAliases = new ArrayList<Alias>();
  for (Alias alias : annotatedObject.getAliases()) {
    if (alias.getCvAliasType() != null
        && (
        alias.getCvAliasType().getIdentifier().equals(miOrLabel)
            ||
            alias.getCvAliasType().getShortLabel().equals(miOrLabel))
        ) {
      matchingAliases.add(alias);
    }
  }
  return matchingAliases;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

public static List<String> getSynonyms(InteractionImpl complex) {
  List<String> synosyms = new ArrayList<String>();
  for (Alias alias : complex.getAliases()) {
    if (alias.getName() != null && alias.getCvAliasType() != null && alias.getCvAliasType().getIdentifier().equals(CvAliasType.COMPLEX_SYNONYM_NAME_MI_REF)) {
      synosyms.add(alias.getName());
    }
  }
  return synosyms;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

public static List<String> getSynonyms(InteractionImpl complex) {
  List<String> synosyms = new ArrayList<String>();
  for (Alias alias : complex.getAliases()) {
    if (alias.getName() != null && alias.getCvAliasType() != null && alias.getCvAliasType().getIdentifier().equals(CvAliasType.COMPLEX_SYNONYM_NAME_MI_REF)) {
      synosyms.add(alias.getName());
    }
  }
  return synosyms;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

private static String getAlias(InteractionImpl complex, String id) {
  for (Alias alias : complex.getAliases()) {
    if (alias.getName() != null && alias.getCvAliasType() != null && alias.getCvAliasType().getIdentifier().equals(id)) {
      return alias.getName();
    }
  }
  return null;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

private static String getAlias(InteractionImpl complex, String id) {
  for (Alias alias : complex.getAliases()) {
    if (alias.getName() != null && alias.getCvAliasType() != null && alias.getCvAliasType().getIdentifier().equals(id)) {
      return alias.getName();
    }
  }
  return null;
}

代码示例来源:origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

@Override
public void visitAlias( Alias alias ) {
  final CvAliasType type = alias.getCvAliasType();
  if( type != null ) {
    final String mi = type.getIdentifier();
    if ( mi != null ) {
      final String key = createCvKey( type.getClass(), mi );
      final CvAliasType oboTerm = ( CvAliasType ) mi2cv.get( key );
      if ( oboTerm == null ) {
        log.warn( "Could not find alias " + type.getClass().getSimpleName() + "( " + type.getShortLabel() + " ) by MI: " + mi );
      } else {
        alias.setCvAliasType( oboTerm );
      }
    }
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

@Override
public void visitAlias(Alias alias) {
  currentNode.setUserObject("Alias: "+alias.getName()+" / Type="+DebugUtil.cvObjectToSimpleString(alias.getCvAliasType()));
}

代码示例来源:origin: uk.ac.ebi.intact/intact-core

private static SearchItem searchItemForAlias( Alias alias ) {
  return new SearchItem( alias.getParentAc(), alias.getName(),
              alias.getParent().getClass().getName(), alias.getCvAliasType().getShortLabel() );
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

@Override
public void visitAlias(Alias alias) {
  currentNode.setUserObject("Alias: "+alias.getName()+" / Type="+DebugUtil.cvObjectToSimpleString(alias.getCvAliasType()));
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

protected Alias cloneAlias(Alias alias) throws IntactClonerException {
  if (alias == null) return null;
  Class clazz = CgLibUtil.removeCglibEnhanced(alias.getClass());
  Alias clone = null;
  try {
    final Constructor constructor = clazz.getConstructor();
    clone = (Alias) constructor.newInstance();
    clonerManager.addClone(alias, clone);
    clone.setCvAliasType(clone(alias.getCvAliasType()));
    clone.setName(alias.getName());
  } catch (Exception e) {
    throw new IntactClonerException("An error occured upon building a " + clazz.getSimpleName(), e);
  }
  return clone;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

protected Alias cloneAlias(Alias alias) throws IntactClonerException {
  if (alias == null) return null;
  Class clazz = CgLibUtil.removeCglibEnhanced(alias.getClass());
  Alias clone = null;
  try {
    final Constructor constructor = clazz.getConstructor();
    clone = (Alias) constructor.newInstance();
    clonerManager.addClone(alias, clone);
    clone.setCvAliasType(clone(alias.getCvAliasType()));
    clone.setName(alias.getName());
  } catch (Exception e) {
    throw new IntactClonerException("An error occured upon building a " + clazz.getSimpleName(), e);
  }
  return clone;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

protected void traverseAlias(Alias alias, IntactVisitor... visitors) {
  if (alias == null) return;
  for (IntactVisitor visitor : visitors) {
    visitor.visitAlias(alias);
  }
  // check if this element has been traversed already, to avoid cyclic recursion
  if (recursionChecker.isAlreadyTraversed(alias)) {
    return;
  }
  traverse(alias.getCvAliasType(), visitors);
  traverse(alias.getOwner(), visitors);
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

protected void traverseAlias(Alias alias, IntactVisitor... visitors) {
  if (alias == null) return;
  for (IntactVisitor visitor : visitors) {
    visitor.visitAlias(alias);
  }
  // check if this element has been traversed already, to avoid cyclic recursion
  if (recursionChecker.isAlreadyTraversed(alias)) {
    return;
  }
  traverse(alias.getCvAliasType(), visitors);
  traverse(alias.getOwner(), visitors);
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

private Alias synchronizeAlias( Alias alias, AnnotatedObject parent ) {
  if (alias.getAc() != null) {
    return IntactContext.getCurrentInstance().getDataContext().getDaoFactory()
        .getAliasDao().getByAc(alias.getAc());
  }
  alias.setCvAliasType( synchronize( alias.getCvAliasType() ) );
  alias.setParent(parent);
  if (alias.getAc() == null && parent.getAc() != null) {
    annotatedObjectsToPersist.put(keyBuilder.keyForAlias(alias), alias);
  }
  return alias;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

private Alias synchronizeAlias( Alias alias, AnnotatedObject parent ) {
  if (alias.getAc() != null) {
    return IntactContext.getCurrentInstance().getDataContext().getDaoFactory()
        .getAliasDao().getByAc(alias.getAc());
  }
  alias.setCvAliasType( synchronize( alias.getCvAliasType() ) );
  alias.setParent(parent);
  if (alias.getAc() == null && parent.getAc() != null) {
    annotatedObjectsToPersist.put(keyBuilder.keyForAlias(alias), alias);
  }
  return alias;
}

相关文章