fiftyone.mobile.detection.factories
Class MemoryFactory

java.lang.Object
  extended by fiftyone.mobile.detection.factories.MemoryFactory

public final class MemoryFactory
extends Object

Factory class used to create a DetectorDataSet from a source data structure. All the entities are held in memory and the source data structure not referenced once the data set is created.

The memory usage of the resulting data set following initialisation will be consistent. The performance of the data set will be very fast compared to the stream based implementation as all required data is loaded into memory and references between related objects set at initialisation. However overall memory usage will be higher than the stream based implementation on lightly loaded environments.

Initialisation may take several seconds depending on system performance. Initialisation calculates all the references between entities. If initialisation is not performed then references will be calculated when needed. As such avoiding initialisation improves the time taken to create the data set, at the expense of performance for the initial detections. The default setting is to initialise the data set.

For more information see http://51degrees.mobi/Support/Documentation/Java


Constructor Summary
MemoryFactory()
           
 
Method Summary
static Dataset create(byte[] data)
           
static Dataset create(byte[] data, boolean init)
           
static Dataset create(String filename)
           
static Dataset create(String filename, boolean init)
           
static Dataset read(BinaryReader reader, boolean init)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryFactory

public MemoryFactory()
Method Detail

create

public static Dataset create(byte[] data)
                      throws IOException
Throws:
IOException

create

public static Dataset create(byte[] data,
                             boolean init)
                      throws IOException
Throws:
IOException

create

public static Dataset create(String filename)
                      throws IOException
Throws:
IOException

create

public static Dataset create(String filename,
                             boolean init)
                      throws IOException
Throws:
IOException

read

public static Dataset read(BinaryReader reader,
                           boolean init)
                    throws IOException
Throws:
IOException