All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.broadinstitute.hellbender.engine.ShardBoundaryShard Maven / Gradle / Ivy

There is a newer version: 4.6.0.0
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy