Dashboard > GridGain User Guide > Table Of Contents > Examples Gallery > Resize Images with Grid-Enabled ExecutorService > GridExecutorImage.java
GridExecutorImage.java
Added by link, last edited by link on Jun 16, 2008
Labels: 
(None)


Example task that demonstrate usage of Grid Executor Service together with GridGain.
This class encapsulates all image data.

Full Source Code

GridExecutorImage.java
package org.gridgain.examples.executor;

import java.io.*;

public class GridExecutorImage implements Serializable {
    /** Image height. */
    private int height;

    /** Image width. */
    private int width;

    /** Image binary data. */
    private byte[] data = null;

    /**
     * Creates image.
     *
     * @param height Image height.
     * @param width Image width.
     * @param data Image binary data.
     */
    public GridExecutorImage(int height, int width, byte[] data) {
        assert data != null;

        this.height = height;
        this.width = width;
        this.data = data;
    }

    /**
     * Gets height.
     *
     * @return Image height.
     */
    public int getHeight() {
        return height;
    }

    /**
     * Gets width.
     *
     * @return Image width.
     */
    public int getWidth() {
        return width;
    }

    /**
     * Gets image binary data.
     *
     * @return Image binary data.
     */
    public byte[] getData() {
        return data;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        final StringBuilder buf = new StringBuilder();

        buf.append(getClass().getName());
        buf.append(" [height=").append(height);
        buf.append(", width=").append(width);
        buf.append(']');

        return buf.toString();
    }
}

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.10 Build:#528 Nov 29, 2006) - Bug/feature request - Contact Administrators