org.egothor.dynamizer
Class Standard

java.lang.Object
  extended by org.egothor.dynamizer.Dynamizer
      extended by org.egothor.dynamizer.Standard
All Implemented Interfaces:
Status

public class Standard
extends Dynamizer

The Standard object is a dynamizer that accepts only DynStruct objects. The object would be initialized via #setCapacity or setState(java.util.Properties). This object does not support transactions.

Author:
Leo Galambos

Constructor Summary
Standard(int capacity, int mergeFac)
          Constructor for the Standard object.
 
Method Summary
 void add(BarrelReader reader)
          Append a new DynStruct barrel to the existing data structure.
 void add(BarrelReader reader, java.lang.String srcLocation)
          Pullovers (moves) a new org.egothor.core.DynStructReader to the existing data structure.
 java.util.Properties getState(java.util.Properties p)
          Return the properties of this Standard.
 boolean lock()
          Not implemented, transactions are not supported.
 void optimize(boolean useSoftDelete)
          Optimize the data structure following a delete (or remove) operation on the managed Barrels.
 void setState(java.util.Properties state)
          Use the given properties for this object.
 boolean unlock()
          Not implemented, transactions are not supported.
 
Methods inherited from class org.egothor.dynamizer.Dynamizer
close, commit, destroy, elements, getSlotter, initializeUnderControl, isDirty, removeDoc, setSlotter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Standard

public Standard(int capacity,
                int mergeFac)
Constructor for the Standard object. Calling this constructor merely creates an instance of the superclass.

Method Detail

setState

public void setState(java.util.Properties state)
Use the given properties for this object.

Parameters:
state - the desired properties

getState

public java.util.Properties getState(java.util.Properties p)
Return the properties of this Standard.

Parameters:
p - the properties which will be also returned for your convenience
Returns:
the properties of this Standard

add

public void add(BarrelReader reader)
Append a new DynStruct barrel to the existing data structure. When the algorithm decides that it has to rebuild the actual barrel structures it calls merger.

Specified by:
add in class Dynamizer
Parameters:
reader - the data structure to append

add

public void add(BarrelReader reader,
                java.lang.String srcLocation)
Description copied from class: Dynamizer
Pullovers (moves) a new org.egothor.core.DynStructReader to the existing data structure. When the algorithm decides that it has to rebuild the actual barrel structures it must optimize.

Specified by:
add in class Dynamizer
srcLocation - location of the structure to be pulled over

optimize

public void optimize(boolean useSoftDelete)
Optimize the data structure following a delete (or remove) operation on the managed Barrels. Call this method only after first removing an element.

Specified by:
optimize in class Dynamizer
Parameters:
useSoftDelete - true meand don't delete barrels directly, only log them as dead barrels. false means direct delete

lock

public boolean lock()
Not implemented, transactions are not supported.

Returns:
true

unlock

public boolean unlock()
Not implemented, transactions are not supported.

Returns:
true