org.norvelle.textcite.model
Class AbstractCitationContainer

java.lang.Object
  extended by org.norvelle.textcite.model.AbstractCitationContainer
Direct Known Subclasses:
Author, Book

public class AbstractCitationContainer
extends java.lang.Object

AbstractCitationContainer: Provides base methods for handling (primarily serializing/deserializing) collections of Citation objects.

Author:
Erik Norvelle

Field Summary
protected  java.util.HashMap<java.lang.Integer,Citation> citations
          This HashMap contains the Citations which reference this Author.
protected  java.util.Vector<java.lang.Integer> citationsIds
          This Vector contains only the IDs of the Citations, not the references to the objects.
 
Constructor Summary
AbstractCitationContainer()
           
 
Method Summary
 void restoreCitationReferences()
          This method restores the citations HashMap, filling it with references to the Citations indicated in the citationIds Vector.
 void saveCitationReferences()
          This method saves the currently references Citations in the citationIds Vector, by id, as the name suggests, so that this Vector can be serialized without serializing the Citations themselves (which get serialized at a later stage)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

citations

protected java.util.HashMap<java.lang.Integer,Citation> citations
This HashMap contains the Citations which reference this Author. If a Citation changes authorship, or is deleted, it should use the unregisterCitation() method to clear its reference from the HashMap


citationsIds

protected java.util.Vector<java.lang.Integer> citationsIds
This Vector contains only the IDs of the Citations, not the references to the objects. It is used to delay serialization of the Citations themselves, when serializing objects that maintain lists of Citations objects

Constructor Detail

AbstractCitationContainer

public AbstractCitationContainer()
Method Detail

saveCitationReferences

public void saveCitationReferences()
This method saves the currently references Citations in the citationIds Vector, by id, as the name suggests, so that this Vector can be serialized without serializing the Citations themselves (which get serialized at a later stage)


restoreCitationReferences

public void restoreCitationReferences()
This method restores the citations HashMap, filling it with references to the Citations indicated in the citationIds Vector.