/*
 * Copyright (c) 2013 DataTorrent, Inc. ALL Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.datatorrent.lib.chart;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.datatorrent.api.BaseOperator;
import com.datatorrent.api.Partitionable;

/**
 * This is the base class for all chart operators
 *
 * @since 0.3.2
 */
public abstract class ChartOperator extends BaseOperator implements Partitionable<ChartOperator>
{
  /**
   * The different types of chart
   */
  public enum Type
  {
    /**
     * Line - One point for each data item. Both X-axis and Y-axis are numbers. X-axis is usually a time-series
     */
    LINE,
    /**
     * Candle - Four points for each data item (open, close, high, low). Both X-axis and Y-axis are numbers. X-axis is usually a time series
     */
    CANDLE,
    /**
     * Enumerated - X-axis is an enumeration set. Y-axis is a number
     */
    ENUM,
    /**
     * Histogram - Like ENUM, except X-axis is a set of ranges.
     */
    HISTOGRAM,
  }

  /**
   * Gets the chart type
   *
   * @return The chart type
   */
  public abstract Type getChartType();

  @Override
  public Collection<Partition<ChartOperator>> definePartitions(Collection<Partition<ChartOperator>> partitions, int incrementalCapacity)
  {
    // prevent partitioning
    List<Partition<ChartOperator>> newPartitions = new ArrayList<Partition<ChartOperator>>(1);
    newPartitions.add(partitions.iterator().next());
    return newPartitions;
  }

}

@@ -657,89 +657,8 @@
 t;%0A%0A
-import java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0A
 impo
@@ -721,29 +721,45 @@
 ent.api.
-Partitionable
+annotation.OperatorAnnotation
 ;%0A%0A/**%0A 
@@ -830,16 +830,57 @@
 3.2%0A */%0A
+@OperatorAnnotation(partitionable=false)%0A
 public a
@@ -931,48 +931,8 @@
 ator
- implements Partitionable%3CChartOperator%3E
 %0A%7B%0A 
@@ -1615,366 +1615,6 @@
 );%0A%0A
-  @Override%0A  public Collection%3CPartition%3CChartOperator%3E%3E definePartitions(Collection%3CPartition%3CChartOperator%3E%3E partitions, int incrementalCapacity)%0A  %7B%0A    // prevent partitioning%0A    List%3CPartition%3CChartOperator%3E%3E newPartitions = new ArrayList%3CPartition%3CChartOperator%3E%3E(1);%0A    newPartitions.add(partitions.iterator().next());%0A    return newPartitions;%0A  %7D%0A%0A
 %7D%0A

Use annotation to declare non-partitionable