Package com.jalios.jstore
Class Swizzler
- java.lang.Object
-
- com.jalios.jstore.Swizzler
-
public class Swizzler extends java.lang.Object
This class manages the id <-> storable maps.- Version:
- $Revision: 134140 $
- Author:
- Olivier Dedieu
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REVISION
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decRC(Storable storable)
Decrements the Reference Counter of the storableStorable
getStorable(java.lang.String id)
void
incRC(Storable storable)
Increments the Reference Counter of the storableboolean
isReferrenced(Storable storable)
boolean
isSwizzled(Storable storable)
Check if the specified Storable (or any storable with matching id) has been saved in Swizzlerboolean
isSwizzled(java.lang.String id)
java.util.Iterator<Storable>
iterator()
Return an iterator on the storable setvoid
registerStorable(Storable storable, java.util.Map<java.lang.String,java.lang.String> attributes)
Swizzler ID <==> Storablevoid
removeStorable(Storable storable)
void
swizzle(java.util.Map<java.lang.String,java.lang.String> attributes)
Replace in the Map the storables by their ID storable -> IDvoid
updateArrayOfReferences(Storable[] array, Storable[] updatedArray)
void
updateReferences(Storable storable, Storable updated)
Updates the references of a storable and its update
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
-
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)
-
-