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

org.canova.api.split.ListStringSplit Maven / Gradle / Ivy

There is a newer version: 0.0.0.17
Show newest version
package org.canova.api.split;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.net.URI;
import java.util.List;

/**
 * An input split that already
 * has delimited data of some kind.
 */
public class ListStringSplit implements InputSplit {
    private List> data;


    public ListStringSplit(List> data) {
        this.data = data;
    }

    /**
     * Length of the split
     *
     * @return
     */
    @Override
    public long length() {
        return data.size();
    }

    /**
     * Locations of the splits
     *
     * @return
     */
    @Override
    public URI[] locations() {
        return new URI[0];
    }

    /**
     * Serialize the fields of this object to out.
     *
     * @param out DataOuput to serialize this object into.
     * @throws IOException
     */
    @Override
    public void write(DataOutput out) throws IOException {

    }

    /**
     * Deserialize the fields of this object from in.
     * 

*

For efficiency, implementations should attempt to re-use storage in the * existing object where possible.

* * @param in DataInput to deseriablize this object from. * @throws IOException */ @Override public void readFields(DataInput in) throws IOException { } /** * Convert Writable to double. Whether this is supported depends on the specific writable. */ @Override public double toDouble() { throw new UnsupportedOperationException(); } /** * Convert Writable to float. Whether this is supported depends on the specific writable. */ @Override public float toFloat() { throw new UnsupportedOperationException(); } /** * Convert Writable to int. Whether this is supported depends on the specific writable. */ @Override public int toInt() { throw new UnsupportedOperationException(); } /** * Convert Writable to long. Whether this is supported depends on the specific writable. */ @Override public long toLong() { throw new UnsupportedOperationException(); } public List> getData() { return data; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy