Package org.aksw.iguana.cc.query.source
Class QuerySource
java.lang.Object
org.aksw.iguana.cc.query.source.QuerySource
- Direct Known Subclasses:
FileSeparatorQuerySource
,FolderQuerySource
The abstract class for a QuerySource.
The QuerySource provides the queries to the QueryList. It abstracts the actual format of the query files.
The QuerySource provides the queries to the QueryList. It abstracts the actual format of the query files.
- Author:
- frensing
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThis method returns all queries in the source as a list of Strings.getPath()
This method returns the path of the file or folder, that contains the queries.abstract String
getQuery
(int index) This method returns the query at the given index.abstract InputStream
getQueryStream
(int index) int
hashCode()
abstract int
size()
This method returns the amount of queries in the source.
-
Field Details
-
path
This string represents the path of the file or folder, that contains the queries. -
hashCode
protected final int hashCodeThis integer represents the hashcode of the file or folder, that contains the queries. It is stored for performance reasons, so that the hashcode does not have to be calculated every time it is needed. (It's needed everytime the id of a query is requested.)
-
-
Constructor Details
-
QuerySource
-
-
Method Details
-
size
public abstract int size()This method returns the amount of queries in the source.- Returns:
- the number of queries in the source
-
getQuery
This method returns the query at the given index.- Parameters:
index
- the index of the query counted from the first query (in the first file)- Returns:
- String of the query
- Throws:
IOException
- if the query could not be read
-
getQueryStream
- Throws:
IOException
-
getAllQueries
This method returns all queries in the source as a list of Strings.- Returns:
- List of Strings of all queries
- Throws:
IOException
- if the queries could not be read
-
getPath
This method returns the path of the file or folder, that contains the queries.- Returns:
- the path of the file or folder, that contains the queries
-
hashCode
public int hashCode()
-