Skip to content

Commit

Permalink
Added consistent I to all interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Miel Vander Sande committed Dec 28, 2015
1 parent 4aad817 commit 5d72031
Show file tree
Hide file tree
Showing 22 changed files with 127 additions and 125 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.linkeddatafragments.datasource;

import org.linkeddatafragments.fragments.LinkedDataFragment;
import org.linkeddatafragments.fragments.ILinkedDataFragment;
import org.linkeddatafragments.fragments.LinkedDataFragmentRequest;

/**
Expand All @@ -15,7 +15,7 @@ abstract public class AbstractRequestProcessor
public void close() {}

@Override
final public LinkedDataFragment createRequestedFragment(
final public ILinkedDataFragment createRequestedFragment(
final LinkedDataFragmentRequest request )
throws IllegalArgumentException
{
Expand All @@ -36,7 +36,7 @@ public Worker( final LinkedDataFragmentRequest request )
this.request = request;
}

abstract public LinkedDataFragment createRequestedFragment()
abstract public ILinkedDataFragment createRequestedFragment()
throws IllegalArgumentException;

} // end of class Worker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import com.hp.hpl.jena.rdf.model.Model;

import org.linkeddatafragments.fragments.LinkedDataFragment;
import org.linkeddatafragments.fragments.ILinkedDataFragment;
import org.linkeddatafragments.fragments.LinkedDataFragmentRequest;
import org.linkeddatafragments.fragments.tpf.TriplePatternElement;
import org.linkeddatafragments.fragments.tpf.TriplePatternFragment;
import org.linkeddatafragments.fragments.tpf.ITriplePatternElement;
import org.linkeddatafragments.fragments.tpf.ITriplePatternFragment;
import org.linkeddatafragments.fragments.tpf.TriplePatternFragmentImpl;
import org.linkeddatafragments.fragments.tpf.TriplePatternFragmentRequest;
import org.linkeddatafragments.fragments.tpf.ITriplePatternFragmentRequest;

/**
* Base class for implementations of {@link IFragmentRequestProcessor} that
* process {@link TriplePatternFragmentRequest}s.
* process {@link ITriplePatternFragmentRequest}s.
*
* @param <TermType> type for representing RDF terms in triple patterns
* @param <VarType> type for representing specific variables in triple patterns
Expand All @@ -27,32 +27,32 @@ protected final Worker<TermType,VarType> getWorker(
final LinkedDataFragmentRequest request )
throws IllegalArgumentException
{
if ( request instanceof TriplePatternFragmentRequest<?,?> ) {
if ( request instanceof ITriplePatternFragmentRequest<?,?> ) {
@SuppressWarnings("unchecked")
final TriplePatternFragmentRequest<TermType,VarType> tpfRequest =
(TriplePatternFragmentRequest<TermType,VarType>) request;
final ITriplePatternFragmentRequest<TermType,VarType> tpfRequest =
(ITriplePatternFragmentRequest<TermType,VarType>) request;
return getTPFSpecificWorker( tpfRequest );
}
else
throw new IllegalArgumentException( request.getClass().getName() );
}

abstract protected Worker<TermType,VarType> getTPFSpecificWorker(
final TriplePatternFragmentRequest<TermType,VarType> request )
final ITriplePatternFragmentRequest<TermType,VarType> request )
throws IllegalArgumentException;


abstract static protected class Worker<TermType,VarType>
extends AbstractRequestProcessor.Worker
{
public Worker(
final TriplePatternFragmentRequest<TermType,VarType> request )
final ITriplePatternFragmentRequest<TermType,VarType> request )
{
super( request );
}

@Override
public LinkedDataFragment createRequestedFragment()
public ILinkedDataFragment createRequestedFragment()
throws IllegalArgumentException
{
final long limit = LinkedDataFragmentRequest.TRIPLESPERPAGE;
Expand All @@ -63,30 +63,30 @@ public LinkedDataFragment createRequestedFragment()
offset = 0L;

@SuppressWarnings("unchecked")
final TriplePatternFragmentRequest<TermType,VarType> tpfRequest =
(TriplePatternFragmentRequest<TermType,VarType>) request;
final ITriplePatternFragmentRequest<TermType,VarType> tpfRequest =
(ITriplePatternFragmentRequest<TermType,VarType>) request;

return createFragment( tpfRequest.getSubject(),
tpfRequest.getPredicate(),
tpfRequest.getObject(),
offset, limit );
}

abstract protected LinkedDataFragment createFragment(
final TriplePatternElement<TermType,VarType> subj,
final TriplePatternElement<TermType,VarType> pred,
final TriplePatternElement<TermType,VarType> obj,
abstract protected ILinkedDataFragment createFragment(
final ITriplePatternElement<TermType,VarType> subj,
final ITriplePatternElement<TermType,VarType> pred,
final ITriplePatternElement<TermType,VarType> obj,
final long offset,
final long limit )
throws IllegalArgumentException;

protected TriplePatternFragment createEmptyTriplePatternFragment()
protected ITriplePatternFragment createEmptyTriplePatternFragment()
{
return new TriplePatternFragmentImpl( request.getFragmentURL(),
request.getDatasetURL() );
}

protected TriplePatternFragment createTriplePatternFragment(
protected ITriplePatternFragment createTriplePatternFragment(
final Model triples,
final long totalSize,
final boolean isLastPage )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* @author mielvandersande
* @author Bart Hanssens
*/
public abstract class DataSource implements IDataSource {
public abstract class DataSourceBase implements IDataSource {
protected String title;
protected String description;

public DataSource(String title, String description) {
public DataSourceBase(String title, String description) {
this.title = title;
this.description = description;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

import java.io.Closeable;

import org.linkeddatafragments.fragments.LinkedDataFragment;
import org.linkeddatafragments.fragments.ILinkedDataFragment;
import org.linkeddatafragments.fragments.ILinkedDataFragment;
import org.linkeddatafragments.fragments.LinkedDataFragmentRequest;
import org.linkeddatafragments.fragments.LinkedDataFragmentRequest;

/**
* Processes {@link LinkedDataFragmentRequest}s and returns
* the requested {@link LinkedDataFragment}s.
* the requested {@link ILinkedDataFragment}s.
*
* @author <a href="http://olafhartig.de">Olaf Hartig</a>
*/
public interface IFragmentRequestProcessor extends Closeable
{
LinkedDataFragment createRequestedFragment(
ILinkedDataFragment createRequestedFragment(
final LinkedDataFragmentRequest request )
throws IllegalArgumentException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import org.linkeddatafragments.datasource.AbstractRequestProcessorForTriplePatterns;
import org.linkeddatafragments.datasource.IFragmentRequestProcessor;
import org.linkeddatafragments.fragments.LinkedDataFragment;
import org.linkeddatafragments.fragments.tpf.TriplePatternElement;
import org.linkeddatafragments.fragments.tpf.TriplePatternFragmentRequest;
import org.linkeddatafragments.fragments.ILinkedDataFragment;
import org.linkeddatafragments.fragments.tpf.ITriplePatternElement;
import org.linkeddatafragments.fragments.tpf.ITriplePatternFragmentRequest;
import org.rdfhdt.hdt.enums.TripleComponentRole;
import org.rdfhdt.hdt.hdt.HDT;
import org.rdfhdt.hdt.hdt.HDTManager;
Expand All @@ -21,7 +21,7 @@

/**
* Implementation of {@link IFragmentRequestProcessor} that processes
* {@link TriplePatternFragmentRequest}s over data stored in HDT.
* {@link ITriplePatternFragmentRequest}s over data stored in HDT.
*
* @author Ruben Verborgh
* @author <a href="http://olafhartig.de">Olaf Hartig</a>
Expand All @@ -46,7 +46,7 @@ public HdtBasedRequestProcessorForTPFs( String hdtFile ) throws IOException

@Override
protected Worker getTPFSpecificWorker(
final TriplePatternFragmentRequest<RDFNode,String> request )
final ITriplePatternFragmentRequest<RDFNode,String> request )
throws IllegalArgumentException
{
return new Worker( request );
Expand All @@ -56,16 +56,16 @@ protected Worker getTPFSpecificWorker(
protected class Worker
extends AbstractRequestProcessorForTriplePatterns.Worker<RDFNode,String>
{
public Worker( final TriplePatternFragmentRequest<RDFNode,String> req )
public Worker( final ITriplePatternFragmentRequest<RDFNode,String> req )
{
super( req );
}

@Override
protected LinkedDataFragment createFragment(
final TriplePatternElement<RDFNode,String> subject,
final TriplePatternElement<RDFNode,String> predicate,
final TriplePatternElement<RDFNode,String> object,
protected ILinkedDataFragment createFragment(
final ITriplePatternElement<RDFNode,String> subject,
final ITriplePatternElement<RDFNode,String> predicate,
final ITriplePatternElement<RDFNode,String> object,
final long offset,
final long limit )
{
Expand Down
4 changes: 2 additions & 2 deletions src/org/linkeddatafragments/datasource/hdt/HdtDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.IOException;

import org.linkeddatafragments.datasource.DataSource;
import org.linkeddatafragments.datasource.DataSourceBase;
import org.linkeddatafragments.datasource.IFragmentRequestProcessor;
import org.linkeddatafragments.fragments.IFragmentRequestParser;
import org.linkeddatafragments.fragments.tpf.TPFRequestParserForJenaBackends;
Expand All @@ -13,7 +13,7 @@
* @author Ruben Verborgh
* @author <a href="http://olafhartig.de">Olaf Hartig</a>
*/
public class HdtDataSource extends DataSource {
public class HdtDataSource extends DataSourceBase {

protected final HdtBasedRequestProcessorForTPFs requestProcessor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.HashMap;

import org.linkeddatafragments.datasource.DataSource;
import org.linkeddatafragments.datasource.DataSourceBase;
import org.linkeddatafragments.datasource.IDataSource;
import org.linkeddatafragments.datasource.IFragmentRequestProcessor;
import org.linkeddatafragments.fragments.IFragmentRequestParser;
Expand All @@ -14,7 +14,7 @@
* @author Miel Vander Sande
* @author <a href="http://olafhartig.de">Olaf Hartig</a>
*/
public class IndexDataSource extends DataSource {
public class IndexDataSource extends DataSourceBase {

protected final IndexRequestProcessorForTPFs requestProcessor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
import org.linkeddatafragments.datasource.AbstractRequestProcessorForTriplePatterns;
import org.linkeddatafragments.datasource.IDataSource;
import org.linkeddatafragments.datasource.IFragmentRequestProcessor;
import org.linkeddatafragments.fragments.LinkedDataFragment;
import org.linkeddatafragments.fragments.tpf.TriplePatternElement;
import org.linkeddatafragments.fragments.tpf.TriplePatternFragmentRequest;
import org.linkeddatafragments.fragments.ILinkedDataFragment;
import org.linkeddatafragments.fragments.tpf.ITriplePatternElement;
import org.linkeddatafragments.fragments.tpf.ITriplePatternFragmentRequest;

/**
* Implementation of {@link IFragmentRequestProcessor} that processes
* {@link TriplePatternFragmentRequest}s over an index that provides
* {@link ITriplePatternFragmentRequest}s over an index that provides
* an overview of all available datasets.
*
* @author Miel Vander Sande
Expand Down Expand Up @@ -58,7 +58,7 @@ public IndexRequestProcessorForTPFs(

@Override
protected Worker getTPFSpecificWorker(
final TriplePatternFragmentRequest<RDFNode,String> request )
final ITriplePatternFragmentRequest<RDFNode,String> request )
throws IllegalArgumentException
{
return new Worker( request );
Expand All @@ -68,16 +68,16 @@ protected Worker getTPFSpecificWorker(
protected class Worker
extends AbstractRequestProcessorForTriplePatterns.Worker<RDFNode,String>
{
public Worker( final TriplePatternFragmentRequest<RDFNode,String> req )
public Worker( final ITriplePatternFragmentRequest<RDFNode,String> req )
{
super( req );
}

@Override
protected LinkedDataFragment createFragment(
final TriplePatternElement<RDFNode,String> s,
final TriplePatternElement<RDFNode,String> p,
final TriplePatternElement<RDFNode,String> o,
protected ILinkedDataFragment createFragment(
final ITriplePatternElement<RDFNode,String> s,
final ITriplePatternElement<RDFNode,String> p,
final ITriplePatternElement<RDFNode,String> o,
final long offset,
final long limit )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

import org.linkeddatafragments.datasource.AbstractRequestProcessorForTriplePatterns;
import org.linkeddatafragments.datasource.IFragmentRequestProcessor;
import org.linkeddatafragments.fragments.LinkedDataFragment;
import org.linkeddatafragments.fragments.tpf.TriplePatternElement;
import org.linkeddatafragments.fragments.tpf.TriplePatternFragmentRequest;
import org.linkeddatafragments.fragments.ILinkedDataFragment;
import org.linkeddatafragments.fragments.tpf.ITriplePatternElement;
import org.linkeddatafragments.fragments.tpf.ITriplePatternFragmentRequest;

/**
* Implementation of {@link IFragmentRequestProcessor} that processes
* {@link TriplePatternFragmentRequest}s over data stored in Jena TDB.
* {@link ITriplePatternFragmentRequest}s over data stored in Jena TDB.
*
* @author Bart Hanssens <[email protected]>
* @author <a href="http://olafhartig.de">Olaf Hartig</a>
Expand All @@ -43,7 +43,7 @@ public class JenaTDBBasedRequestProcessorForTPFs

@Override
protected Worker getTPFSpecificWorker(
final TriplePatternFragmentRequest<RDFNode,String> request )
final ITriplePatternFragmentRequest<RDFNode,String> request )
throws IllegalArgumentException
{
return new Worker( request );
Expand All @@ -53,16 +53,16 @@ protected Worker getTPFSpecificWorker(
protected class Worker
extends AbstractRequestProcessorForTriplePatterns.Worker<RDFNode,String>
{
public Worker( final TriplePatternFragmentRequest<RDFNode,String> req )
public Worker( final ITriplePatternFragmentRequest<RDFNode,String> req )
{
super( req );
}

@Override
protected LinkedDataFragment createFragment(
final TriplePatternElement<RDFNode,String> subject,
final TriplePatternElement<RDFNode,String> predicate,
final TriplePatternElement<RDFNode,String> object,
protected ILinkedDataFragment createFragment(
final ITriplePatternElement<RDFNode,String> subject,
final ITriplePatternElement<RDFNode,String> predicate,
final ITriplePatternElement<RDFNode,String> object,
final long offset,
final long limit )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.File;

import org.linkeddatafragments.datasource.DataSource;
import org.linkeddatafragments.datasource.DataSourceBase;
import org.linkeddatafragments.datasource.IFragmentRequestProcessor;
import org.linkeddatafragments.fragments.IFragmentRequestParser;
import org.linkeddatafragments.fragments.tpf.TPFRequestParserForJenaBackends;
Expand All @@ -13,7 +13,7 @@
* @author Bart Hanssens <[email protected]>
* @author <a href="http://olafhartig.de">Olaf Hartig</a>
*/
public class JenaTDBDataSource extends DataSource {
public class JenaTDBDataSource extends DataSourceBase {

protected final JenaTDBBasedRequestProcessorForTPFs requestProcessor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author <a href="http://olafhartig.de">Olaf Hartig</a>
*/
public interface LinkedDataFragment
public interface ILinkedDataFragment
{
/**
* Returns an iterator over the RDF data of this fragment (possibly only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
import com.hp.hpl.jena.rdf.model.StmtIterator;

/**
* Base class of any implementation of {@link LinkedDataFragment} that uses
* Base class of any implementation of {@link ILinkedDataFragment} that uses
* paging.
*
* @author <a href="http://olafhartig.de">Olaf Hartig</a>
*/
public abstract class LinkedDataFragmentBase implements LinkedDataFragment
public abstract class LinkedDataFragmentBase implements ILinkedDataFragment
{
public final String fragmentURL;
public final String datasetURL;
Expand Down
Loading

0 comments on commit 5d72031

Please sign in to comment.