Fix dspace-api module per new code style

This commit is contained in:
Tim Donohue
2018-02-14 10:53:46 -06:00
parent 8ffc97f7f9
commit 8a48f782ea
1051 changed files with 53347 additions and 63373 deletions

View File

@@ -7,78 +7,71 @@
*/
package org.dspace.checker;
import org.dspace.content.Bitstream;
import java.sql.SQLException;
import org.dspace.content.Bitstream;
import org.dspace.core.factory.CoreServiceFactory;
/**
* Decorator that dispatches a specified number of bitstreams from a delegate
* dispatcher.
*
*
* @author Jim Downing
* @author Grace Carpenter
* @author Nathan Sarr
*
*/
public class LimitedCountDispatcher implements BitstreamDispatcher
{
/** The remaining number of bitstreams to iterate through. */
public class LimitedCountDispatcher implements BitstreamDispatcher {
/**
* The remaining number of bitstreams to iterate through.
*/
private int remaining = 1;
/** The dispatcher to delegate to for retrieving bitstreams. */
/**
* The dispatcher to delegate to for retrieving bitstreams.
*/
private BitstreamDispatcher delegate = null;
/**
* Default constructor uses LegacyPluginServiceImpl
*/
public LimitedCountDispatcher()
{
public LimitedCountDispatcher() {
this((BitstreamDispatcher) CoreServiceFactory.getInstance().getPluginService()
.getSinglePlugin(BitstreamDispatcher.class));
.getSinglePlugin(BitstreamDispatcher.class));
}
/**
* Constructor.
*
* @param del
* The bitstream distpatcher to delegate to.
* @param count
* the number of bitstreams to check.
*
* @param del The bitstream distpatcher to delegate to.
* @param count the number of bitstreams to check.
*/
public LimitedCountDispatcher(BitstreamDispatcher del, int count)
{
public LimitedCountDispatcher(BitstreamDispatcher del, int count) {
this(del);
remaining = count;
}
/**
* Constructor.
*
* @param del
* The bitstream distpatcher to delegate to.
*
* @param del The bitstream distpatcher to delegate to.
*/
public LimitedCountDispatcher(BitstreamDispatcher del)
{
public LimitedCountDispatcher(BitstreamDispatcher del) {
delegate = del;
}
/**
* Retreives the next bitstream to be checked.
*
*
* @return the bitstream
* @throws SQLException if database error
*/
@Override
public Bitstream next() throws SQLException {
if (remaining > 0)
{
if (remaining > 0) {
remaining--;
return delegate.next();
}
else
{
} else {
return null;
}
}