Class AliasUtils


  • public class AliasUtils
    extends Object
    Utility class for aliases
    Since:
    01/02/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • AliasUtils

        public AliasUtils()
    • 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 alias
        typeId - : alias type MI identifier
        typeName - : 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 analyse
        typeId - : the alias type MI identifier
        typeName - : 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 Alias
        typeId - : the type id to look for
        typeName - : 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 Checksum
        typeId - : the method id to look for
        typeName - : 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 alias
        typeId - : the alias type MI identifier
        typeName - : the alias type name
        name - : 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 analyse
        typeId - : : the alias type MI identifier
        typeName - : : the alias type name
        name - : 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 Alias
        typeId - : the type id to look for
        typeName - : the type name to look for
        name - : 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 Checksum
        typeId - : the method id to look for
        typeName - : the method name to look for
        name - : alias name
      • createGeneName

        public static Alias createGeneName​(String name)

        createGeneName

        Parameters:
        name - a String object.
        Returns:
        a Alias object.
      • createComplexSynonym

        public static Alias createComplexSynonym​(String name)

        createComplexSynonym

        Parameters:
        name - a String object.
        Returns:
        a Alias object.
      • createAuthorAssignedName

        public static Alias createAuthorAssignedName​(String name)

        createAuthorAssignedName

        Parameters:
        name - a String object.
        Returns:
        a Alias object.
      • createGeneNameSynonym

        public static Alias createGeneNameSynonym​(String name)

        createGeneNameSynonym

        Parameters:
        name - a String object.
        Returns:
        a Alias object.
      • createIsoformSynonym

        public static Alias createIsoformSynonym​(String name)

        createIsoformSynonym

        Parameters:
        name - a String object.
        Returns:
        a Alias object.
      • createOrfName

        public static Alias createOrfName​(String name)

        createOrfName

        Parameters:
        name - a String object.
        Returns:
        a Alias object.
      • createLocusName

        public static Alias createLocusName​(String name)

        createLocusName

        Parameters:
        name - a String object.
        Returns:
        a Alias object.
      • createAlias

        public static Alias createAlias​(String typeName,
                                        String name)

        createAlias

        Parameters:
        typeName - a String object.
        name - a String object.
        Returns:
        a Alias object.