org.eclipse.birt.chart.engine.extension_3.7.2.v20120213

16:41:25.384 INFO  jd.cli.Main - Decompiling org.eclipse.birt.chart.engine.extension_3.7.2.v20120213.jar
package org.eclipse.birt.chart.engine.extension.i18n;

import com.ibm.icu.util.ULocale;
import com.ibm.icu.util.UResourceBundle;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.birt.chart.util.SecurityUtil;

public final class Messages
{
  private static final String ENGINE_EXTENSION = "org.eclipse.birt.chart.engine.extension.i18n.nls";
  private static final ResourceBundle RESOURCE_BUNDLE = UResourceBundle.getBundleInstance("org.eclipse.birt.chart.engine.extension.i18n.nls", 
    ULocale.getDefault(), 
    SecurityUtil.getClassLoader(Messages.class));
  private static Map<ULocale, ResourceBundle> hmLocalToBundle = new HashMap(2);
  
  public static ResourceBundle getResourceBundle()
  {
    return RESOURCE_BUNDLE;
  }
  
  public static ResourceBundle getResourceBundle(ULocale locale)
  {
    if (locale == null) {
      return RESOURCE_BUNDLE;
    }
    ResourceBundle bundle = (ResourceBundle)hmLocalToBundle.get(locale);
    if (bundle == null)
    {
      bundle = getMatchedResourceBundle(locale, 
        "org.eclipse.birt.chart.engine.extension.i18n.nls", 
        Messages.class);
      if (bundle != null) {
        hmLocalToBundle.put(locale, bundle);
      }
    }
    return bundle;
  }
  
  private static ResourceBundle getMatchedResourceBundle(ULocale locale, String baseName, Class clazz)
  {
    ResourceBundle bundle = UResourceBundle.getBundleInstance(baseName, 
      locale, 
      SecurityUtil.getClassLoader(clazz));
    if (bundle != null)
    {
      String language = locale.getLanguage();
      String country = locale.getCountry();
      boolean useDefaultResource = true;
      if ((language.length() == 0) && (country.length() == 0))
      {
        useDefaultResource = false;
      }
      else
      {
        Locale bundleLocale = bundle.getLocale();
        if ((bundleLocale.getLanguage().length() == 0) && 
          (bundleLocale.getCountry().length() == 0))
        {
          useDefaultResource = false;
        }
        else if (language.equals(bundleLocale.getLanguage()))
        {
          String bundleCountry = bundleLocale.getCountry();
          if ((country.equals(bundleCountry)) || 
            (bundleCountry.length() == 0)) {
            useDefaultResource = false;
          }
        }
      }
      if (useDefaultResource) {
        bundle = ResourceBundle.getBundle(baseName, 
          new Locale("", ""));
      }
    }
    return bundle;
  }
  
  public static String getString(String key, ULocale lcl)
  {
    try
    {
      return getResourceBundle(lcl).getString(key);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + key + '!';
  }
  
  public static String getString(String key)
  {
    try
    {
      return getResourceBundle().getString(key);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + key + '!';
  }
  
  public static String getString(String key, Object[] oa, ULocale lcl)
  {
    try
    {
      return SecurityUtil.formatMessage(getResourceBundle(lcl).getString(key), 
        oa);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + key + '!';
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.engine.extension.i18n.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import java.math.BigDecimal;
import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.i18n.Messages;

public class Average
  extends AggregateFunctionAdapter
{
  private Object oSum = null;
  private int iIterationCount = 0;
  
  public void initialize()
  {
    super.initialize();
    oSum = null;
    iIterationCount = 0;
  }
  
  public void accumulate(Object oValue)
    throws IllegalArgumentException
  {
    super.accumulate(oValue);
    if (oValue != null) {
      iIterationCount += 1;
    }
    if ((getDataType() != 0) && 
      (getDataType() != 4) && 
      (getDataType() != 5)) {
      throw new IllegalArgumentException(Messages.getString("exception.unsupported.aggregate.function.input", 
        getClass().getName(), 
        getLocale()));
    }
    switch (getDataType())
    {
    case 4: 
      if (oSum == null)
      {
        oSum = new double[1];
        
        ((double[])oSum)[0] = 0.0D;
      }
      ((double[])oSum)[0] += ((Number)oValue).doubleValue();
      break;
    case 5: 
      if (oSum == null) {
        oSum = new BigDecimal(0);
      }
      oSum = ((BigDecimal)oSum).add((BigDecimal)oSum);
    }
  }
  
  public Object getAggregatedValue()
  {
    switch (getDataType())
    {
    case 4: 
      return new Double(((double[])oSum)[0] / iIterationCount);
    case 5: 
      return ((BigDecimal)oSum).divide(new BigDecimal(iIterationCount), 
        7);
    }
    return null;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Average
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class Bottom
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("Bottom.AggregateFunction.Parameters.Label.N") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getType()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 1;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Bottom
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class BottomPercent
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("BottomPercent.AggregateFunction.Parameters.Label.Percentage") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getType()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 1;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.BottomPercent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class Count
  extends AggregateFunctionAdapter
{
  private int iCount;
  
  public void accumulate(Object oValue)
    throws IllegalArgumentException
  {
    iCount += 1;
  }
  
  public void initialize()
  {
    iCount = 0;
  }
  
  public Object getAggregatedValue()
  {
    return Integer.valueOf(iCount);
  }
  
  public int getBIRTDataType()
  {
    return 2;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Count
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import java.util.HashSet;
import java.util.Set;
import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class DistinctCount
  extends AggregateFunctionAdapter
{
  private Set<Object> uniqueValues;
  
  public void accumulate(Object oValue)
    throws IllegalArgumentException
  {
    uniqueValues.add(oValue);
  }
  
  public Object getAggregatedValue()
  {
    return Integer.valueOf(uniqueValues.size());
  }
  
  public void initialize()
  {
    uniqueValues = new HashSet();
  }
  
  public int getBIRTDataType()
  {
    return 2;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.DistinctCount
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class First
  extends AggregateFunctionAdapter
{
  private Object first;
  
  public void accumulate(Object oValue)
    throws IllegalArgumentException
  {
    if ((first == null) && (oValue != null)) {
      first = oValue;
    }
  }
  
  public Object getAggregatedValue()
  {
    return first;
  }
  
  public void initialize()
  {
    first = null;
  }
  
  public int getBIRTDataType()
  {
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.First
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class Irr
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("Irr.AggregateFunction.Parameters.Label.Intrate") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Irr
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class Last
  extends AggregateFunctionAdapter
{
  private Object last;
  
  public void accumulate(Object oValue)
    throws IllegalArgumentException
  {
    if (oValue != null) {
      last = oValue;
    }
  }
  
  public Object getAggregatedValue()
  {
    return last;
  }
  
  public void initialize()
  {
    last = null;
  }
  
  public int getBIRTDataType()
  {
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Last
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class Max
  extends AggregateFunctionAdapter
{
  private Object max;
  
  public void accumulate(Object oValue)
    throws IllegalArgumentException
  {
    if (max == null) {
      max = oValue;
    } else if ((oValue instanceof Comparable)) {
      max = (((Comparable)oValue).compareTo(max) >= 0 ? oValue : max);
    }
  }
  
  public Object getAggregatedValue()
  {
    return max;
  }
  
  public void initialize()
  {
    max = null;
  }
  
  public int getBIRTDataType()
  {
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Max
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class Median
  extends AggregateFunctionAdapter
{
  public int getBIRTDataType()
  {
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Median
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class Min
  extends AggregateFunctionAdapter
{
  private Object min;
  
  public void accumulate(Object oValue)
    throws IllegalArgumentException
  {
    if (min == null) {
      min = oValue;
    } else if ((oValue instanceof Comparable)) {
      min = (((Comparable)oValue).compareTo(min) <= 0 ? oValue : min);
    }
  }
  
  public Object getAggregatedValue()
  {
    return min;
  }
  
  public void initialize()
  {
    min = null;
  }
  
  public int getBIRTDataType()
  {
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Min
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class Mirr
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("Mirr.AggregateFunction.Parameters.Label.FinanceRate"), Messages.getString("Mirr.AggregateFunction.Parameters.Label.ReinvestmentRate") };
  }
  
  public int getParametersCount()
  {
    return 2;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Mirr
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class Mode
  extends AggregateFunctionAdapter
{
  public int getBIRTDataType()
  {
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Mode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class MovingAverage
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("MovingAverage.AggregateFunction.Parameters.Label.Window") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getType()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.MovingAverage
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class Npv
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("Npv.AggregateFunction.Parameters.Label.Rate") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Npv
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class PercentRank
  extends AggregateFunctionAdapter
{
  public int getType()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.PercentRank
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class PercentSum
  extends AggregateFunctionAdapter
{
  public int getType()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.PercentSum
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class Percentile
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("Percentile.AggregateFunction.Parameters.Label.Percentage") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Percentile
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class Quartile
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("Quartile.AggregateFunction.Parameters.Label.Quart") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Quartile
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class Rank
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("Rank.AggregateFunction.Parameters.Label.Ascending") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getType()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 2;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Rank
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class RunningCount
  extends AggregateFunctionAdapter
{
  public int getType()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 2;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.RunningCount
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class RunningNpv
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("RunningNpv.AggregateFunction.Parameters.Label.Rate") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getType()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.RunningNpv
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class RunningSum
  extends AggregateFunctionAdapter
{
  public int getType()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.RunningSum
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class StdDev
  extends AggregateFunctionAdapter
{
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.StdDev
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import java.math.BigDecimal;
import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.i18n.Messages;

public class Sum
  extends AggregateFunctionAdapter
{
  private Object oSum = null;
  
  public void initialize()
  {
    super.initialize();
    oSum = null;
  }
  
  public void accumulate(Object oValue)
    throws IllegalArgumentException
  {
    if (oValue == null) {
      return;
    }
    super.accumulate(oValue);
    if ((getDataType() != 0) && 
      (getDataType() != 4) && 
      (getDataType() != 5)) {
      throw new IllegalArgumentException(Messages.getString("exception.unsupported.aggregate.function.input", 
        getClass().getName(), 
        getLocale()));
    }
    switch (getDataType())
    {
    case 4: 
      if (oSum == null)
      {
        oSum = new double[1];
        
        ((double[])oSum)[0] = 0.0D;
      }
      ((double[])oSum)[0] += ((Number)oValue).doubleValue();
      break;
    case 5: 
      if (oSum == null) {
        oSum = new BigDecimal(0);
      }
      oSum = ((BigDecimal)oSum).add((BigDecimal)oSum);
    }
  }
  
  public Object getAggregatedValue()
  {
    switch (getDataType())
    {
    case 4: 
      return new Double(((double[])oSum)[0]);
    }
    return oSum;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Sum
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class Top
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("Top.AggregateFunction.Parameters.Label.N") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getType()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 1;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Top
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class TopPercent
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("TopPercent.AggregateFunction.Parameters.Label.Percentage") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getType()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 1;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.TopPercent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;

public class Variance
  extends AggregateFunctionAdapter
{
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.Variance
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.aggregate;

import org.eclipse.birt.chart.aggregate.AggregateFunctionAdapter;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class WeightedAverage
  extends AggregateFunctionAdapter
{
  public String[] getDisplayParameters()
  {
    return new String[] { Messages.getString("WeightedAverage.AggregateFunction.Parameters.Label.Weight") };
  }
  
  public int getParametersCount()
  {
    return 1;
  }
  
  public int getBIRTDataType()
  {
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.aggregate.WeightedAverage
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.datafeed;

import org.eclipse.birt.chart.datafeed.AbstractDataPointDefinition;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;

public class BubbleDataPointDefinition
  extends AbstractDataPointDefinition
{
  public static final String TYPE_VALUE = "bubble_value";
  public static final String TYPE_SIZE = "bubble_size";
  private final String[] saTypeNames = {
    "bubble_value", "bubble_size" };
  private final int[] iaTypeCompatibles = {
    1, 1 };
  
  public String[] getDataPointTypes()
  {
    return saTypeNames;
  }
  
  public String getDisplayText(String type)
  {
    if ("bubble_value".equals(type)) {
      return Messages.getString("info.datapoint.BubbleValue");
    }
    if ("bubble_size".equals(type)) {
      return Messages.getString("info.datapoint.BubbleSize");
    }
    return null;
  }
  
  public int getCompatibleDataType(String type)
  {
    for (int i = 0; i < saTypeNames.length; i++) {
      if (saTypeNames[i].equals(type)) {
        return iaTypeCompatibles[i];
      }
    }
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.datafeed.BubbleDataPointDefinition
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.datafeed;

import com.ibm.icu.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.StringTokenizer;
import java.util.Vector;
import org.eclipse.birt.chart.computation.DataSetIterator;
import org.eclipse.birt.chart.datafeed.DataSetAdapter;
import org.eclipse.birt.chart.datafeed.IResultSetDataSet;
import org.eclipse.birt.chart.engine.extension.i18n.Messages;
import org.eclipse.birt.chart.exception.ChartException;
import org.eclipse.birt.chart.model.component.Series;
import org.eclipse.birt.chart.model.data.DataSet;
import org.eclipse.birt.chart.model.data.impl.BubbleDataSetImpl;
import org.eclipse.birt.chart.model.data.impl.DataSetImpl;
import org.eclipse.birt.chart.util.BigNumber;
import org.eclipse.birt.chart.util.CDateTime;
import org.eclipse.birt.chart.util.NumberUtil;

public class BubbleDataSetProcessorImpl
  extends DataSetAdapter
{
  public Object getMaximum(DataSet ds)
    throws ChartException
  {
    DataSetIterator dsi = null;
    try
    {
      dsi = new DataSetIterator(ds);
      dsi.reset();
    }
    catch (IllegalArgumentException uiex)
    {
      throw new ChartException("org.eclipse.birt.chart.engine.extension", 
        1, 
        uiex);
    }
    if (dsi.size() == 0) {
      throw new ChartException("org.eclipse.birt.chart.engine.extension", 
        1, 
        "exception.empty.dataset", 
        Messages.getResourceBundle(getULocale()));
    }
    CDateTime cMax = null;
    double dMax = -1.7976931348623157E308D;
    Number bnMax = null;
    for (int i = 0; dsi.hasNext(); i++)
    {
      BubbleEntry bde = (BubbleEntry)dsi.next();
      if (bde != null)
      {
        Object oValue = bde.getValue();
        if (oValue != null) {
          if (NumberUtil.isBigNumber(oValue))
          {
            BigNumber bnValue = (BigNumber)oValue;
            if (bde.getSizeNumber() != null) {
              bnValue = bnValue.add((BigNumber)bde.getSizeNumber());
            }
            if (bnMax == null) {
              bnMax = bnValue;
            } else {
              bnMax = ((BigNumber)bnMax).max(bnValue);
            }
          }
          else if ((oValue instanceof com.ibm.icu.math.BigDecimal))
          {
            com.ibm.icu.math.BigDecimal bnValue = (com.ibm.icu.math.BigDecimal)oValue;
            if (bde.getSizeNumber() != null) {
              bnValue = bnValue.add((com.ibm.icu.math.BigDecimal)bde.getSizeNumber());
            }
            if (bnMax == null) {
              bnMax = bnValue;
            } else {
              bnMax = ((com.ibm.icu.math.BigDecimal)bnMax).max(bnValue);
            }
          }
          else if ((oValue instanceof java.math.BigDecimal))
          {
            java.math.BigDecimal bnValue = (java.math.BigDecimal)oValue;
            if (bde.getSizeNumber() != null) {
              bnValue = bnValue.add((java.math.BigDecimal)bde.getSizeNumber());
            }
            if (bnMax == null) {
              bnMax = bnValue;
            } else {
              bnMax = ((java.math.BigDecimal)bnMax).max(bnValue);
            }
          }
          else if ((oValue instanceof Number))
          {
            double dValue = ((Number)oValue).doubleValue();
            if (i == 0) {
              dMax = dValue;
            } else {
              dMax = Math.max(dMax, dValue);
            }
          }
          else if ((oValue instanceof CDateTime))
          {
            CDateTime cValue = (CDateTime)oValue;
            if (i == 0) {
              cMax = cValue;
            } else if (cValue.after(cMax)) {
              cMax = cValue;
            }
          }
        }
      }
    }
    if (cMax == null) {
      return bnMax != null ? bnMax : new Double(dMax);
    }
    return cMax;
  }
  
  public Object getMinimum(DataSet ds)
    throws ChartException
  {
    DataSetIterator dsi = null;
    try
    {
      dsi = new DataSetIterator(ds);
      dsi.reset();
    }
    catch (IllegalArgumentException uiex)
    {
      throw new ChartException("org.eclipse.birt.chart.engine.extension", 
        1, 
        uiex);
    }
    if (dsi.size() == 0) {
      throw new ChartException("org.eclipse.birt.chart.engine.extension", 
        1, 
        "exception.empty.dataset", 
        Messages.getResourceBundle(getULocale()));
    }
    CDateTime cMin = null;
    double dMin = Double.MAX_VALUE;
    Number bnMin = null;
    for (int i = 0; dsi.hasNext(); i++)
    {
      BubbleEntry bde = (BubbleEntry)dsi.next();
      if (bde != null)
      {
        Object oValue = bde.getValue();
        if (oValue != null) {
          if (NumberUtil.isBigNumber(oValue))
          {
            BigNumber bnValue = (BigNumber)oValue;
            if (bde.getSizeNumber() != null) {
              bnValue = bnValue.subtract((BigNumber)bde.getSizeNumber());
            }
            if (bnMin == null) {
              bnMin = bnValue;
            } else {
              bnMin = ((BigNumber)bnMin).min(bnValue);
            }
          }
          else if ((oValue instanceof com.ibm.icu.math.BigDecimal))
          {
            com.ibm.icu.math.BigDecimal bnValue = (com.ibm.icu.math.BigDecimal)oValue;
            if (bde.getSizeNumber() != null) {
              bnValue = bnValue.subtract((com.ibm.icu.math.BigDecimal)bde.getSizeNumber());
            }
            if (bnMin == null) {
              bnMin = bnValue;
            } else {
              bnMin = ((com.ibm.icu.math.BigDecimal)bnMin).min(bnValue);
            }
          }
          else if ((oValue instanceof java.math.BigDecimal))
          {
            java.math.BigDecimal bnValue = (java.math.BigDecimal)oValue;
            if (bde.getSizeNumber() != null) {
              bnValue = bnValue.subtract((java.math.BigDecimal)bde.getSizeNumber());
            }
            if (bnMin == null) {
              bnMin = bnValue;
            } else {
              bnMin = ((java.math.BigDecimal)bnMin).min(bnValue);
            }
          }
          else if ((oValue instanceof Number))
          {
            double dValue = ((Number)oValue).doubleValue();
            if (i == 0) {
              dMin = dValue;
            } else {
              dMin = Math.min(dMin, dValue);
            }
          }
          else if ((oValue instanceof CDateTime))
          {
            CDateTime cValue = (CDateTime)oValue;
            if (i == 0) {
              cMin = cValue;
            } else if (cValue.before(cMin)) {
              cMin = cValue;
            }
          }
        }
      }
    }
    if (cMin == null) {
      return bnMin != null ? bnMin : new Double(dMin);
    }
    return cMin;
  }
  
  public final DataSet populate(Object oResultSetDef, DataSet ds)
    throws ChartException
  {
    if ((oResultSetDef instanceof IResultSetDataSet))
    {
      IResultSetDataSet rsds = (IResultSetDataSet)oResultSetDef;
      long lRowCount = rsds.getSize();
      if (lRowCount <= 0L) {
        throw new ChartException("org.eclipse.birt.chart.engine.extension", 
          16, 
          "exception.empty.dataset", 
          Messages.getResourceBundle(getULocale()));
      }
      int dataType = rsds.getDataType(0);
      boolean isBigDecimal = false;
      int i = 0;
      BubbleEntry[] bea = new BubbleEntry[(int)lRowCount];
      if (dataType == 1) {
        while (rsds.hasNext())
        {
          o = rsds.next();
          validateBubbleEntryData(o);
          bea[(i++)] = new BubbleEntry(NumberUtil.convertNumber(o[0]), 
            NumberUtil.convertNumber(o[1]));
          if (((!isBigDecimal) && 
            (NumberUtil.isBigDecimal(o[0]))) || 
            (NumberUtil.isBigDecimal(o[1]))) {
            isBigDecimal = true;
          }
        }
      } else {
        while (rsds.hasNext())
        {
          Object[] o;
          Object[] o = rsds.next();
          validateBubbleEntryData(o);
          Object value = o[0];
          Object size = o[1];
          if (dataType == 8) {
            bea[i] = new BubbleEntry(value == null ? null : value, 
              size);
          } else {
            bea[i] = new BubbleEntry(value, size, i + 1);
          }
          i++;
        }
      }
      if (ds == null) {
        ds = BubbleDataSetImpl.create(bea);
      } else {
        ds.setValues(bea);
      }
      ((DataSetImpl)ds).setIsBigNumber(isBigDecimal);
    }
    else
    {
      throw new ChartException("org.eclipse.birt.chart.engine.extension", 
        1, 
        "exception.unknown.custom.dataset", 
        new Object[] {
        ds, oResultSetDef }, 
        
        Messages.getResourceBundle(getULocale()));
    }
    return ds;
  }
  
  private void validateBubbleEntryData(Object[] obja)
    throws ChartException
  {
    boolean valid = true;
    if (obja == null) {
      valid = false;
    } else if (obja.length != 2) {
      throw new ChartException("org.eclipse.birt.chart.engine.extension", 
        1, 
        "exception.dataset.bubbleseries", 
        Messages.getResourceBundle(getULocale()));
    }
    if (!valid) {
      throw new ChartException("org.eclipse.birt.chart.engine.extension", 
        30, 
        "exception.dataset.null.bubbleentry", 
        Messages.getResourceBundle(getULocale()));
    }
  }
  
  public final DataSet fromString(String sDataSetRepresentation, DataSet ds)
    throws ChartException
  {
    if (sDataSetRepresentation == null) {
      return ds;
    }
    if (ds == null) {
      ds = BubbleDataSetImpl.create(null);
    }
    StringTokenizer strTokDataElement = new StringTokenizer(sDataSetRepresentation, 
      ",");
    StringTokenizer strTokComponents = null;
    String strDataElement = null;
    String strComponent = null;
    Vector<BubbleEntry> vData = new Vector();
    int[] sizes = {
      3, 5, 4, 6, 4 };
    
    int i = 0;
    while (strTokDataElement.hasMoreTokens())
    {
      strDataElement = strTokDataElement.nextToken().trim();
      strTokComponents = new StringTokenizer(strDataElement);
      if (strTokComponents.countTokens() == 1)
      {
        Object value = null;
        try
        {
          value = new Double(Double.parseDouble(strDataElement));
        }
        catch (NumberFormatException localNumberFormatException)
        {
          SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
          try
          {
            value = new CDateTime(sdf.parse(strDataElement));
          }
          catch (ParseException localParseException)
          {
            value = null;
          }
        }
        vData.add(new BubbleEntry(value, Integer.valueOf(sizes[(i++)])));
      }
      else
      {
        BubbleEntry entry = new BubbleEntry(Integer.valueOf(1), 
          Integer.valueOf(1));
        while (strTokComponents.hasMoreTokens())
        {
          strComponent = 
          
            strTokComponents.nextToken().trim().toUpperCase();
          if (strComponent.startsWith("Y")) {
            entry.setValue(strComponent.substring(1));
          } else if (strComponent.startsWith("S")) {
            entry.setSize(Double.parseDouble(strComponent.substring(1)));
          }
        }
        vData.add(entry);
      }
    }
    ds.setValues(vData);
    return ds;
  }
  
  public String getExpectedStringFormat()
  {
    return Messages.getString("info.bubble.sample.format", getULocale());
  }
  
  public String toString(Object[] columnData)
    throws ChartException
  {
    if ((columnData == null) || (columnData.length == 0)) {
      throw new ChartException("org.eclipse.birt.chart.engine.extension", 
        1, 
        "exception.base.orthogonal.null.datadefinition", 
        Messages.getResourceBundle(getULocale()));
    }
    StringBuffer buffer = new StringBuffer();
    for (int i = 0; i < columnData.length; i++)
    {
      if (columnData[i] == null) {
        throw new ChartException("org.eclipse.birt.chart.engine.extension", 
          1, 
          "exception.base.orthogonal.null.datadefinition", 
          Messages.getResourceBundle(getULocale()));
      }
      if ((columnData[i] instanceof Object[])) {
        buffer.append(toBubbleString((Object[])columnData[i]));
      }
      if (i < columnData.length - 1) {
        buffer.append(",");
      }
    }
    return buffer.toString();
  }
  
  private StringBuffer toBubbleString(Object[] bubbleArray)
    throws ChartException
  {
    if ((bubbleArray.length != 2) || (bubbleArray[0] == null)) {
      throw new ChartException("org.eclipse.birt.chart.engine.extension", 
        1, 
        "Invalid data set column");
    }
    StringBuffer buffer = new StringBuffer();
    buffer.append("Y" + String.valueOf(bubbleArray[0]) + " ");
    buffer.append("S" + String.valueOf(bubbleArray[1]));
    return buffer;
  }
  
  public int[] getDataDefIdsForGrouping(Series series)
  {
    return new int[] {
      0, 1 };
  }
}

/* Location:
 * Qualified Name:     org.eclipse.birt.chart.extension.datafeed.BubbleDataSetProcessorImpl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.birt.chart.extension.datafeed;

import com.ibm.icu.util.ULocale;
import org.eclipse.birt.chart.computation.ValueFormatter;
import org.eclipse.birt.chart.datafeed.NumberDataPointEntry;
import org.eclipse.birt.chart.exception.ChartException;
import org.eclipse.birt.chart.log.ILogger;
import org.eclipse.birt.chart.log.Logger;
import org.eclipse.birt.chart.model.attribute.FormatSpecifier;
import org.eclipse.birt.chart.model.attribute.FractionNumberFormatSpecifier;
import org.eclipse.birt.chart.model.attribute.JavaNumberFormatSpecifier;
import org.eclipse.birt.chart.model.attribute.NumberFormatSpecifier;
import org.eclipse.birt.chart.util.BigNumber;
import org.eclipse.birt.chart.util.NumberUtil;

public final class BubbleEntry
  extends NumberDataPointEntry
{
  private static ILogger logger = Logger.getLogger("org.eclipse.birt.chart.engine.extension/render");
  private Object oValue;
  private double dSize;
  private BigNumber bnSize;
  private Number bdSize;
  private boolean bIsBigNumber = false;
  private boolean bIsBigDecimal = false;
  private com.ibm.icu.math.BigDecimal divisor;
  private int index = 0;
  
  public BubbleEntry(Object value, Object size, int index)
  {
    this(value, size);
    this.index = index;
  }
  
  public BubbleEntry(Object value, Object size)
  {
    init(value, size);
  }
  
  private void init(Object value, Object size)
  {
    if (NumberUtil.isBigNumber(value))
    {
      bIsBigNumber = true;
      divisor = ((BigNumber)value).getDivisor();
      bnSize = ((BigNumber)size);
    }
    else if (NumberUtil.isBigDecimal(value))
    {
      bIsBigDecimal = true;
      if (NumberUtil.isJavaMathBigDecimal(value)) {
        bdSize = NumberUtil.asJavaMathBigDecimal((Number)size);
      } else {
        bdSize = NumberUtil.asBigDecimal((Number)size);
      }
    }
    oValue = value;
    if (((value instanceof Double)) && (((Double)value).isNaN())) {
      oValue = null;
    }
    dSize = ((size instanceof Number) ? ((Number)size).doubleValue() : 
      0.0D);
  }
  
  public String toString()
  {
    return getFormattedString(null, ULocale.getDefault());
  }
  
  public final Object getValue()
  {
    if (index > 0) {
      re
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd