
package jp.riken.brain.ni.samuraigraph.base;

/**
 * データの基本クラス
 */

public abstract class SGData implements SGICopiable
{

	/**
	 * Default constructor.
	 *
	 */
	public SGData()
	{
	}


	/**
	 * Set values in given data.
	 * @param data
	 * @return
	 */
	public abstract boolean setData( final SGData data );


	/**
	 * Returns the number of data points.
	 * @return
	 */
	public abstract int getPointsNumber();



	/**
	 * 
	 * @param array
	 * @return
	 */
	protected String toDoubleArrayString( double[] array )
	{
		if( array==null )
		{
			return "null";
		}

		String str = "{";
		for( int ii=0; ii<array.length; ii++ )
		{
			str += Double.toString( array[ii] );
			if( ii==array.length-1 )
			{
				break;
			}
			str += ",";
		}
		str += "}";
		return str;
	}


}
