Class Swizzler


  • public class Swizzler
    extends java.lang.Object
    This class manages the id <-> storable maps.
    Version:
    $Revision: 134140 $
    Author:
    Olivier Dedieu
    • Method Detail

      • registerStorable

        public void registerStorable​(Storable storable,
                                     java.util.Map<java.lang.String,​java.lang.String> attributes)
        Swizzler ID <==> Storable
      • removeStorable

        public void removeStorable​(Storable storable)
      • updateReferences

        public void updateReferences​(Storable storable,
                                     Storable updated)
                              throws java.io.IOException
        Updates the references of a storable and its update
        Parameters:
        storable - the old referenced storable
        updated - the updated storable
        Throws:
        java.io.IOException
      • updateArrayOfReferences

        public void updateArrayOfReferences​(Storable[] array,
                                            Storable[] updatedArray)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getStorable

        public Storable getStorable​(java.lang.String id)
      • isSwizzled

        public boolean isSwizzled​(Storable storable)
        Check if the specified Storable (or any storable with matching id) has been saved in Swizzler
        Parameters:
        storable - a Storable instance, may be null
        Returns:
        false if specified storable is null, has a null id, or has not been stored in swizzler, true if storable was found in swizzler
      • isSwizzled

        public boolean isSwizzled​(java.lang.String id)
      • iterator

        public java.util.Iterator<Storable> iterator()
        Return an iterator on the storable set
        Returns:
        the storable iterator.
      • swizzle

        public void swizzle​(java.util.Map<java.lang.String,​java.lang.String> attributes)
        Replace in the Map the storables by their ID storable -> ID
      • incRC

        public void incRC​(Storable storable)
        Increments the Reference Counter of the storable
        Parameters:
        storable - the target storable
      • decRC

        public void decRC​(Storable storable)
        Decrements the Reference Counter of the storable
        Parameters:
        storable - the target storable
      • isReferrenced

        public boolean isReferrenced​(Storable storable)