public class FilePersistenceStrategy extends Object implements PersistenceStrategy
Constructor and Description |
---|
FilePersistenceStrategy(File file) |
Modifier and Type | Method and Description |
---|---|
Factorization |
load()
Load a factorization from a persistent store.
|
void |
maybePersist(Factorization factorization)
Write a factorization to a persistent store unless it already
contains an identical factorization.
|
static Factorization |
readBinary(DataInput in) |
protected static void |
writeBinary(Factorization factorization,
DataOutput out) |
public FilePersistenceStrategy(File file)
file
- the file to use for storage. If the file does not exist it will be created when required.public Factorization load() throws IOException
PersistenceStrategy
load
in interface PersistenceStrategy
IOException
public void maybePersist(Factorization factorization) throws IOException
PersistenceStrategy
maybePersist
in interface PersistenceStrategy
IOException
protected static void writeBinary(Factorization factorization, DataOutput out) throws IOException
IOException
public static Factorization readBinary(DataInput in) throws IOException
IOException
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.