org.schmant.support
Class FutureEntityIndexStrategy

java.lang.Object
  extended by org.schmant.support.FutureEntityIndexStrategy
All Implemented Interfaces:
FutureEntityStrategy

public class FutureEntityIndexStrategy
extends Object
implements FutureEntityStrategy

This is a FutureEntityStrategy that creates future entities of the form [base_directory]/[prefix][index][suffix]. The index is incremented for each new FutureEntity object created.

Since:
0.6
Author:
Karl Gustafsson

Constructor Summary
FutureEntityIndexStrategy(DirectoryView baseDir, String prefix, String suffix)
          Create a FutureEntityIndexStrategy.
FutureEntityIndexStrategy(DirectoryView baseDir, String prefix, String suffix, int firstIndex)
          Create a FutureEntityIndexStrategy.
 
Method Summary
 FutureEntity createFutureEntity(Object source)
          Create a future entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FutureEntityIndexStrategy

public FutureEntityIndexStrategy(DirectoryView baseDir,
                                 String prefix,
                                 String suffix)
Create a FutureEntityIndexStrategy. The index of the first created FutureEntity will be 1.

Parameters:
baseDir - The base directory.
prefix - The prefix of the future entity name.
suffix - The suffix of the future entity name.

FutureEntityIndexStrategy

public FutureEntityIndexStrategy(DirectoryView baseDir,
                                 String prefix,
                                 String suffix,
                                 int firstIndex)
Create a FutureEntityIndexStrategy. The index of the first created FutureEntity will be the supplied value.

Parameters:
baseDir - The base directory.
prefix - The prefix of the future entity name.
suffix - The suffix of the future entity name.
firstIndex - The index number of the first created future entity.
Method Detail

createFutureEntity

public FutureEntity createFutureEntity(Object source)
Description copied from interface: FutureEntityStrategy
Create a future entity.

Specified by:
createFutureEntity in interface FutureEntityStrategy
Parameters:
source - The source entity. The this entity should be interpreted in the same way as the task does.
Returns:
A FutureEntity