org.broadinstitute.hellbender.engine.ShardBoundaryShard Maven / Gradle / Ivy
package org.broadinstitute.hellbender.engine;
import java.io.Serializable;
import org.broadinstitute.hellbender.utils.SimpleInterval;
import java.util.Iterator;
/**
* A {@link Shard} backed by a {@link ShardBoundary} and a collection of records.
*/
public final class ShardBoundaryShard implements Shard, Serializable {
private static final long serialVersionUID = 1L;
private final ShardBoundary shardBoundary;
private final Iterable locatables;
/**
* Create a new {@link ShardBoundaryShard} from the given {@link ShardBoundary} and records.
* @param shardBoundary the boundary defining the shard
* @param locatables the records overlapping the shard
*/
public ShardBoundaryShard(ShardBoundary shardBoundary, Iterable locatables) {
this.shardBoundary = shardBoundary;
this.locatables = locatables;
}
@Override
public SimpleInterval getInterval() {
return shardBoundary.getInterval();
}
@Override
public SimpleInterval getPaddedInterval() {
return shardBoundary.getPaddedSpan();
}
@Override
public Iterator iterator() {
return locatables.iterator();
}
public ShardBoundary getShardBoundary() {
return shardBoundary;
}
}