Class InMemoryPsiXmlCache

  • All Implemented Interfaces:
    PsiXmlIdCache

    public class InMemoryPsiXmlCache
    extends Object
    implements PsiXmlIdCache
    PsiXmlIdCache that stores objects in memory using a map
    Since:
    06/11/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • InMemoryPsiXmlCache

        public InMemoryPsiXmlCache​(PsiXmlVersion version)

        Constructor for InMemoryPsiXmlCache.

        Parameters:
        version - a PsiXmlVersion object.
    • Method Detail

      • getAvailability

        public AbstractAvailability getAvailability​(int id)

        getAvailability.

        Specified by:
        getAvailability in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        the availability registered with this id, null if it does not exist
      • getExperiment

        public Experiment getExperiment​(int id)

        getExperiment.

        Specified by:
        getExperiment in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        the experiment registered with this id, null if it does not exist
      • getInteraction

        public Interaction getInteraction​(int id)

        getInteraction.

        Specified by:
        getInteraction in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        the interaction registered with this id, null if it does not exist
      • getInteractor

        public Interactor getInteractor​(int id)

        getInteractor.

        Specified by:
        getInteractor in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        the interactor registered with this id, null if it does not exist
      • registerParticipant

        public void registerParticipant​(int id,
                                        Entity object)
        Register a participant with an id
        Specified by:
        registerParticipant in interface PsiXmlIdCache
        Parameters:
        id - a int.
        object - a Entity object.
      • getParticipant

        public Entity getParticipant​(int id)

        getParticipant.

        Specified by:
        getParticipant in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        the participant registered with this id, null if it does not exist
      • registerFeature

        public void registerFeature​(int id,
                                    Feature object)
        Register a feature with an id
        Specified by:
        registerFeature in interface PsiXmlIdCache
        Parameters:
        id - a int.
        object - a Feature object.
      • getFeature

        public Feature getFeature​(int id)

        getFeature.

        Specified by:
        getFeature in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        the feature registered with this id, null if it does not exist
      • getComplexParticipant

        public ModelledEntity getComplexParticipant​(int id)

        getComplexParticipant.

        Specified by:
        getComplexParticipant in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        the participant registered with this id, null if it does not exist
      • getComplexFeature

        public ModelledFeature getComplexFeature​(int id)

        getComplexFeature.

        Specified by:
        getComplexFeature in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        the feature registered with this id, null if it does not exist
      • registerComplex

        public void registerComplex​(int id,
                                    Complex object)
        Register a complex with an id
        Specified by:
        registerComplex in interface PsiXmlIdCache
        Parameters:
        id - a int.
        object - a Complex object.
      • getComplex

        public Complex getComplex​(int id)

        getComplex.

        Specified by:
        getComplex in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        the complex registered with this id, null if it does not exist
      • getVariableParameterValue

        public VariableParameterValue getVariableParameterValue​(int id)

        getVariableParameterValue.

        Specified by:
        getVariableParameterValue in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        the variable parameter value registered with this id, null if it does not exist
      • clear

        public void clear()
        Clear all existing records
        Specified by:
        clear in interface PsiXmlIdCache
      • close

        public void close()
        Close cache
        Specified by:
        close in interface PsiXmlIdCache
      • containsExperiment

        public boolean containsExperiment​(int id)
        To know if it contains a specific id
        Specified by:
        containsExperiment in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        a boolean.
      • containsAvailability

        public boolean containsAvailability​(int id)
        To know if it contains a specific id
        Specified by:
        containsAvailability in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        a boolean.
      • containsInteraction

        public boolean containsInteraction​(int id)
        To know if it contains a specific id
        Specified by:
        containsInteraction in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        a boolean.
      • containsInteractor

        public boolean containsInteractor​(int id)
        To know if it contains a specific id
        Specified by:
        containsInteractor in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        a boolean.
      • containsParticipant

        public boolean containsParticipant​(int id)
        To know if it contains a specific id
        Specified by:
        containsParticipant in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        a boolean.
      • containsFeature

        public boolean containsFeature​(int id)
        To know if it contains a specific id
        Specified by:
        containsFeature in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        a boolean.
      • containsVariableParameter

        public boolean containsVariableParameter​(int id)
        To know if it contains a specific id
        Specified by:
        containsVariableParameter in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        a boolean.
      • containsComplex

        public boolean containsComplex​(int id)
        To know if it contains a specific id
        Specified by:
        containsComplex in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        a boolean.
      • containsComplexParticipant

        public boolean containsComplexParticipant​(int id)
        To know if it contains a specific id
        Specified by:
        containsComplexParticipant in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        a boolean.
      • containsComplexFeature

        public boolean containsComplexFeature​(int id)
        To know if it contains a specific id
        Specified by:
        containsComplexFeature in interface PsiXmlIdCache
        Parameters:
        id - a int.
        Returns:
        a boolean.