Package psidev.psi.mi.jami.xml.cache
Class InMemoryLightIdentityObjectCache
- java.lang.Object
- 
- psidev.psi.mi.jami.xml.cache.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 SummaryConstructors Constructor Description InMemoryLightIdentityObjectCache()Constructor for InMemoryLightIdentityObjectCache.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()clear.Set<ModelledInteraction>clearRegisteredSubComplexes()This method will return all registered complexes and clear them from the indexvoidclose()Close cachebooleancontains(Object o)True if it contains this objectintextractIdForAvailability(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 registeredintextractIdForComplex(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 registeredintextractIdForExperiment(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 registeredintextractIdForFeature(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 registeredintextractIdForInteraction(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 registeredintextractIdForInteractor(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 registeredintextractIdForParticipant(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 registeredintextractIdForVariableParameterValue(VariableParameterValue 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 registeredintgetLastGeneratedId()getLastGeneratedId.booleanhasRegisteredSubComplexes()hasRegisteredSubComplexes.voidregisterSubComplex(ModelledInteraction c)This method will register a complex that is used as an interactorvoidremoveObject(Object o)removeObject.voidresetLastGeneratedIdTo(int id)Reset the last generated id to a specific value
 
- 
- 
- 
Method Detail- 
extractIdForAvailabilitypublic 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:
- extractIdForAvailabilityin interface- PsiXmlObjectCache
- Parameters:
- av- a- Stringobject.
- Returns:
- the id assigned to this object
 
 - 
extractIdForExperimentpublic 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:
- extractIdForExperimentin interface- PsiXmlObjectCache
- Parameters:
- o- a- Experimentobject.
- Returns:
- the id assigned to this object
 
 - 
extractIdForInteractorpublic 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:
- extractIdForInteractorin interface- PsiXmlObjectCache
- Parameters:
- o- a- Interactorobject.
- Returns:
- the id assigned to this object
 
 - 
extractIdForInteractionpublic 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:
- extractIdForInteractionin interface- PsiXmlObjectCache
- Parameters:
- o- a- Interactionobject.
- Returns:
- the id assigned to this object
 
 - 
extractIdForParticipantpublic 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:
- extractIdForParticipantin interface- PsiXmlObjectCache
- Parameters:
- o- a- Entityobject.
- Returns:
- the id assigned to this object
 
 - 
extractIdForFeaturepublic 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:
- extractIdForFeaturein interface- PsiXmlObjectCache
- Parameters:
- o- a- Featureobject.
- Returns:
- the id assigned to this object
 
 - 
extractIdForVariableParameterValuepublic int extractIdForVariableParameterValue(VariableParameterValue 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:
- extractIdForVariableParameterValuein interface- PsiXmlObjectCache
- Parameters:
- o- a- VariableParameterValueobject.
- Returns:
- the id assigned to this object
 
 - 
extractIdForComplexpublic 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:
- extractIdForComplexin interface- PsiXmlObjectCache
- Parameters:
- o- a- Complexobject.
- Returns:
- the id assigned to this object
 
 - 
clearpublic void clear() clear. - Specified by:
- clearin interface- PsiXmlObjectCache
 
 - 
closepublic void close() Close cache- Specified by:
- closein interface- PsiXmlObjectCache
 
 - 
containspublic boolean contains(Object o) True if it contains this object- Specified by:
- containsin interface- PsiXmlObjectCache
- Parameters:
- o- a- Objectobject.
- Returns:
- a boolean.
 
 - 
registerSubComplexpublic void registerSubComplex(ModelledInteraction c) This method will register a complex that is used as an interactor- Specified by:
- registerSubComplexin interface- PsiXmlObjectCache
- Parameters:
- c- a- ModelledInteractionobject.
 
 - 
clearRegisteredSubComplexespublic Set<ModelledInteraction> clearRegisteredSubComplexes() This method will return all registered complexes and clear them from the index- Specified by:
- clearRegisteredSubComplexesin interface- PsiXmlObjectCache
- Returns:
- a Setobject.
 
 - 
hasRegisteredSubComplexespublic boolean hasRegisteredSubComplexes() hasRegisteredSubComplexes. - Specified by:
- hasRegisteredSubComplexesin interface- PsiXmlObjectCache
- Returns:
- true if the index has registered som sub complexes, fasle otherwise
 
 - 
removeObjectpublic void removeObject(Object o) removeObject. - Specified by:
- removeObjectin interface- PsiXmlObjectCache
- Parameters:
- o- a- Objectobject.
 
 - 
getLastGeneratedIdpublic int getLastGeneratedId() getLastGeneratedId. - Specified by:
- getLastGeneratedIdin interface- PsiXmlObjectCache
- Returns:
- the last generated id
 
 - 
resetLastGeneratedIdTopublic void resetLastGeneratedIdTo(int id) Reset the last generated id to a specific value- Specified by:
- resetLastGeneratedIdToin interface- PsiXmlObjectCache
- Parameters:
- id- a int.
 
 
- 
 
-