Package com.jalios.jstore
Class Swizzler
- java.lang.Object
-
- com.jalios.jstore.Swizzler
-
public class Swizzler extends java.lang.ObjectThis class manages the id <-> storable maps.- Author:
- Olivier Dedieu
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecRC(Storable storable)Decrements the Reference Counter of the storableStorablegetStorable(java.lang.String id)voidincRC(Storable storable)Increments the Reference Counter of the storablebooleanisReferrenced(Storable storable)booleanisSwizzled(Storable storable)Check if the specified Storable (or any storable with matching id) has been saved in SwizzlerbooleanisSwizzled(java.lang.String id)java.util.Iterator<Storable>iterator()Return an iterator on the storable setvoidregisterStorable(Storable storable, java.util.Map<java.lang.String,java.lang.String> attributes)Swizzler ID <==> StorablevoidremoveStorable(Storable storable)voidswizzle(java.util.Map<java.lang.String,java.lang.String> attributes)Replace in the Map the storables by their ID storable -> IDvoidupdateArrayOfReferences(Storable[] array, Storable[] updatedArray)voidupdateReferences(Storable storable, Storable updated)Updates the references of a storable and its update
-
-
-
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 storableupdated- 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)
-
-