Class InMemoryLightIdentityObjectCache

  • All Implemented Interfaces:
    PsiXmlObjectCache

    public class InMemoryLightIdentityObjectCache
    extends Object
    implements PsiXmlObjectCache
    It keeps a in memory cache of objects having an id. The cache is based on a in memory Identity map. It will only keep experiments, interactions, features and participants in memory. It will ignore interactors and availability
    Since:
    19/11/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • InMemoryLightIdentityObjectCache

        public InMemoryLightIdentityObjectCache()

        Constructor for InMemoryLightIdentityObjectCache.

    • Method Detail

      • extractIdForAvailability

        public int extractIdForAvailability​(String av)
        This method will extract the id for this object if it is already registered, assign an id and register the object if not already registered
        Specified by:
        extractIdForAvailability in interface PsiXmlObjectCache
        Parameters:
        av - a String object.
        Returns:
        the id assigned to this object
      • extractIdForExperiment

        public int extractIdForExperiment​(Experiment o)
        This method will extract the id for this object if it is already registered, assign an id and register the object if not already registered
        Specified by:
        extractIdForExperiment in interface PsiXmlObjectCache
        Parameters:
        o - a Experiment object.
        Returns:
        the id assigned to this object
      • extractIdForInteractor

        public int extractIdForInteractor​(Interactor o)
        This method will extract the id for this object if it is already registered, assign an id and register the object if not already registered
        Specified by:
        extractIdForInteractor in interface PsiXmlObjectCache
        Parameters:
        o - a Interactor object.
        Returns:
        the id assigned to this object
      • extractIdForInteraction

        public int extractIdForInteraction​(Interaction o)
        This method will extract the id for this object if it is already registered, assign an id and register the object if not already registered
        Specified by:
        extractIdForInteraction in interface PsiXmlObjectCache
        Parameters:
        o - a Interaction object.
        Returns:
        the id assigned to this object
      • extractIdForParticipant

        public int extractIdForParticipant​(Entity o)
        This method will extract the id for this object if it is already registered, assign an id and register the object if not already registered
        Specified by:
        extractIdForParticipant in interface PsiXmlObjectCache
        Parameters:
        o - a Entity object.
        Returns:
        the id assigned to this object
      • extractIdForFeature

        public int extractIdForFeature​(Feature o)
        This method will extract the id for this object if it is already registered, assign an id and register the object if not already registered
        Specified by:
        extractIdForFeature in interface PsiXmlObjectCache
        Parameters:
        o - a Feature object.
        Returns:
        the id assigned to this object
      • extractIdForComplex

        public int extractIdForComplex​(Complex o)
        This method will extract the id for this object if it is already registered, assign an id and register the object if not already registered
        Specified by:
        extractIdForComplex in interface PsiXmlObjectCache
        Parameters:
        o - a Complex object.
        Returns:
        the id assigned to this object
      • contains

        public boolean contains​(Object o)
        True if it contains this object
        Specified by:
        contains in interface PsiXmlObjectCache
        Parameters:
        o - a Object object.
        Returns:
        a boolean.
      • hasRegisteredSubComplexes

        public boolean hasRegisteredSubComplexes()

        hasRegisteredSubComplexes.

        Specified by:
        hasRegisteredSubComplexes in interface PsiXmlObjectCache
        Returns:
        true if the index has registered som sub complexes, fasle otherwise
      • resetLastGeneratedIdTo

        public void resetLastGeneratedIdTo​(int id)
        Reset the last generated id to a specific value
        Specified by:
        resetLastGeneratedIdTo in interface PsiXmlObjectCache
        Parameters:
        id - a int.