Package psidev.psi.mi.jami.utils
Class AliasUtils
- java.lang.Object
-
- psidev.psi.mi.jami.utils.AliasUtils
-
public class AliasUtils extends Object
Utility class for aliases- Since:
01/02/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description AliasUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Collection<Alias>
collectAllAliasesHavingType(Collection<? extends Alias> aliases, String typeId, String typeName)
Extract all the aliases having a specific type.static Collection<Alias>
collectAllAliasesHavingTypeAndName(Collection<? extends Alias> aliases, String typeId, String typeName, String name)
Extract all the aliases having a specific type.static Alias
collectFirstAliasWithType(Collection<? extends Alias> aliases, String typeId, String typeName)
This method will return the first Alias having this typeId/type name It will return null if there are no Alias with this type id/namestatic Alias
collectFirstAliasWithTypeAndName(Collection<? extends Alias> aliases, String typeId, String typeName, String name)
This method will return the first Alias having this typeId/type name It will return null if there are no Alias with this type id/namestatic Alias
createAlias(String typeName, String name)
createAliasstatic Alias
createAlias(String typeName, String typeMi, String name)
createAliasstatic Alias
createAuthorAssignedName(String name)
createAuthorAssignedNamestatic Alias
createComplexSynonym(String name)
createComplexSynonymstatic Alias
createGeneName(String name)
createGeneNamestatic Alias
createGeneNameSynonym(String name)
createGeneNameSynonymstatic Alias
createIsoformSynonym(String name)
createIsoformSynonymstatic Alias
createLocusName(String name)
createLocusNamestatic Alias
createOrfName(String name)
createOrfNamestatic boolean
doesAliasHaveType(Alias alias, String typeId, String typeName)
To know if an alias have a specific type.static boolean
doesAliasHaveTypeAndName(Alias alias, String typeId, String typeName, String name)
To know if an alias have a specific type and name.static void
removeAllAliasesWithType(Collection<? extends Alias> aliases, String typeId, String typeName)
Remove all Alias having this method name/method id from the collection of aliasesstatic void
removeAllAliasesWithTypeAndName(Collection<Alias> aliases, String typeId, String typeName, String name)
Remove all Alias having this method name/method id from the collection of aliases
-
-
-
Method Detail
-
doesAliasHaveType
public static boolean doesAliasHaveType(Alias alias, String typeId, String typeName)
To know if an alias have a specific type.- Parameters:
alias
- : the aliastypeId
- : alias type MI identifiertypeName
- : alias type name- Returns:
- true if the alias has the type with given name/identifier
-
collectAllAliasesHavingType
public static Collection<Alias> collectAllAliasesHavingType(Collection<? extends Alias> aliases, String typeId, String typeName)
Extract all the aliases having a specific type.- Parameters:
aliases
- : the aliases to analysetypeId
- : the alias type MI identifiertypeName
- : the alias type name- Returns:
- the selection of aliases having the specified type (typeId or typeName if no ids)
-
collectFirstAliasWithType
public static Alias collectFirstAliasWithType(Collection<? extends Alias> aliases, String typeId, String typeName)
This method will return the first Alias having this typeId/type name It will return null if there are no Alias with this type id/name- Parameters:
aliases
- : the collection of AliastypeId
- : the type id to look fortypeName
- : the type name to look for- Returns:
- the first alias having this type name/id, null if no Alias with this type name/id
-
removeAllAliasesWithType
public static void removeAllAliasesWithType(Collection<? extends Alias> aliases, String typeId, String typeName)
Remove all Alias having this method name/method id from the collection of aliases- Parameters:
aliases
- : the collection of ChecksumtypeId
- : the method id to look fortypeName
- : the method name to look for
-
doesAliasHaveTypeAndName
public static boolean doesAliasHaveTypeAndName(Alias alias, String typeId, String typeName, String name)
To know if an alias have a specific type and name.- Parameters:
alias
- : the aliastypeId
- : the alias type MI identifiertypeName
- : the alias type namename
- : alias name- Returns:
- true if the alias has the type with given name/identifier
-
collectAllAliasesHavingTypeAndName
public static Collection<Alias> collectAllAliasesHavingTypeAndName(Collection<? extends Alias> aliases, String typeId, String typeName, String name)
Extract all the aliases having a specific type.- Parameters:
aliases
- : : the aliases to analysetypeId
- : : the alias type MI identifiertypeName
- : : the alias type namename
- : alias name- Returns:
- the selection of aliases having the specified type (typeId or typeName if no ids)
-
collectFirstAliasWithTypeAndName
public static Alias collectFirstAliasWithTypeAndName(Collection<? extends Alias> aliases, String typeId, String typeName, String name)
This method will return the first Alias having this typeId/type name It will return null if there are no Alias with this type id/name- Parameters:
aliases
- : the collection of AliastypeId
- : the type id to look fortypeName
- : the type name to look forname
- : alias name- Returns:
- the first alias having this type name/id, null if no Alias with this type name/id
-
removeAllAliasesWithTypeAndName
public static void removeAllAliasesWithTypeAndName(Collection<Alias> aliases, String typeId, String typeName, String name)
Remove all Alias having this method name/method id from the collection of aliases- Parameters:
aliases
- : the collection of ChecksumtypeId
- : the method id to look fortypeName
- : the method name to look forname
- : alias name
-
createAuthorAssignedName
public static Alias createAuthorAssignedName(String name)
createAuthorAssignedName
-
createAlias
public static Alias createAlias(String typeName, String typeMi, String name)
createAlias
-
-