|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.AbstractCleanable de.hpi.fgis.dude.datasource.AbstractDataSource<S>
S
- Type of subclass for fluent interface.public abstract class AbstractDataSource<S extends AbstractDataSource<S>>
AbstractDataSource
provides the common functionality of all DataSource
classes. The concrete DataSource
implementations should extend this class in order to reduce the implementation effort.
DataSource
,
AbstractIterator
Nested Class Summary | |
---|---|
protected class |
AbstractDataSource.AbstractDataSourceIterator<T extends AbstractDataSource<?>>
AbstractDataSourceIterator can be used to generate valid DuDeObject s. |
Constructor Summary | |
---|---|
protected |
AbstractDataSource()
Internal constructor for Jsonable deserialization. |
protected |
AbstractDataSource(String id)
Initializes a AbstractDataExtractor with the passed identifier. |
Method Summary | |
---|---|
void |
addIdAttributes(String... attributes)
Sets the attributes that shall be used for id generation. |
protected boolean |
autoGeneratedIds()
Checks whether the object id is generated automatically. |
void |
close()
|
boolean |
equals(Object obj)
|
int |
getExtractedRecordCount()
Returns the number of already extracted records. |
protected Iterable<String> |
getIdAttributes()
Returns the set id attributes. |
String |
getIdentifier()
Returns the identifier of this DataSource . |
int |
hashCode()
|
abstract Iterator<DuDeObject> |
iterator()
|
protected void |
setExtractedRecordCount(int extractedRecordCnt)
Resets the extracted-record count, if the passed count is larger than the current one. |
String |
toString()
|
S |
withIdAttributes(String... attributes)
Sets the id attributes. |
Methods inherited from class de.hpi.fgis.dude.util.AbstractCleanable |
---|
cleanUp, registerCleanable, registerCloseable |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.hpi.fgis.dude.util.Cleanable |
---|
cleanUp, registerCleanable, registerCloseable |
Constructor Detail |
---|
protected AbstractDataSource()
Jsonable
deserialization.
protected AbstractDataSource(String id)
AbstractDataExtractor
with the passed identifier.
id
- The identifier that is used within each generated DuDeObject
as its source identifier.Method Detail |
---|
public String getIdentifier()
DataSource
DataSource
. This identifier is used as a source id for each DuDeObject
that is extracted
out of the current DataSource
instance.
getIdentifier
in interface DataSource
DataSource
's identifier.public void addIdAttributes(String... attributes)
DataSource
addIdAttributes
in interface DataSource
attributes
- The attributes that shall be used for id generation.public S withIdAttributes(String... attributes)
attributes
- The id attributes which shall be used.
addIdAttributes(String...)
protected boolean autoGeneratedIds()
true
, if no id attributes are set; otherwise false
.protected Iterable<String> getIdAttributes()
public abstract Iterator<DuDeObject> iterator()
iterator
in interface Iterable<DuDeObject>
protected void setExtractedRecordCount(int extractedRecordCnt)
extractedRecordCnt
- The new record count. If this value is not larger than the current one, no reset is performed.public int getExtractedRecordCount()
DataSource
getExtractedRecordCount
in interface DataSource
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public void close() throws IOException
close
in interface Closeable
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |