public class GeoFileRepository<T extends IGeoPointInfo> extends java.lang.Object implements IGeoRepository<T>
GeoPointDto
> in a file.
Created by k3b on 17.03.2015.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMMENT |
protected java.util.List<T> |
mData
the content of the repository
|
Constructor and Description |
---|
GeoFileRepository(java.io.File file,
GeoPointDto factory)
connect repository to file
|
Modifier and Type | Method and Description |
---|---|
protected GeoPointDto |
create() |
java.lang.String |
createId()
generate a new id
|
boolean |
delete(T item)
removes item from repository.
|
protected boolean |
isValid(IGeoPointInfo geo)
returns true if geo should be loaded from / saved to repository
|
java.util.List<T> |
load()
load from repository
|
void |
load(java.util.List<T> result,
java.io.Reader reader)
load points from reader
|
protected GeoPointDto |
loadItem(java.lang.String line) |
java.util.List<T> |
reload()
uncached, fresh load from repository
|
boolean |
save()
save to repository
|
protected boolean |
saveItem(java.io.Writer writer,
T geo) |
public static final java.lang.String COMMENT
protected java.util.List<T extends IGeoPointInfo> mData
public GeoFileRepository(java.io.File file, GeoPointDto factory)
public java.util.List<T> load()
load
in interface IGeoRepository<T extends IGeoPointInfo>
public java.util.List<T> reload()
reload
in interface IGeoRepository<T extends IGeoPointInfo>
public java.lang.String createId()
createId
in interface IGeoRepository<T extends IGeoPointInfo>
public boolean delete(T item)
delete
in interface IGeoRepository<T extends IGeoPointInfo>
item
- that should be removedpublic boolean save()
save
in interface IGeoRepository<T extends IGeoPointInfo>
public void load(java.util.List<T> result, java.io.Reader reader) throws java.io.IOException
java.io.IOException
protected GeoPointDto loadItem(java.lang.String line)
protected GeoPointDto create()
protected boolean saveItem(java.io.Writer writer, T geo) throws java.io.IOException
java.io.IOException
protected boolean isValid(IGeoPointInfo geo)