Package uk.org.ogsadai.activity

Examples of uk.org.ogsadai.activity.ActivityUserException


                    instance.setValue(i, value);
                }
            }
            else
            {
                throw new ActivityUserException(
                        new Exception("Unsupported attribute type"));
            }
        }
        return instance;
View Full Code Here


                LOG.debug("BuildClassifier evaluation: " + ev.toSummaryString());
              }
            }
        }
        catch (InvalidWekaOptionsException e) {
          throw new ActivityUserException(e);
        }
        catch (Exception e)
        {
            throw new ActivityUserException(e);
        }
        try
        {
            TupleClassifier tupleClassifier =
                new TupleClassifier(
View Full Code Here

            {
                return index;
            }
            else
            {
                throw new ActivityUserException(
                        new ColumnNotFoundException((String)block));
            }
        }
        else
        {
View Full Code Here

    {
        Object block;
        block = readBlock(mNominalValuesInput); // BEGIN outer list of nominal values
        if (block != ControlBlock.LIST_BEGIN)
        {
            throw new ActivityUserException(
                    new MalformedListBeginException(INPUT_NOMINAL_VALUES));
        }
        block = readBlock(mColumnInput); // BEGIN outer list of column indices
        if (block != ControlBlock.LIST_BEGIN)
        {
            throw new ActivityUserException(
                    new MalformedListBeginException(INPUT_COLUMN_INDICES));
        }
        Map<Integer, List<Object>> result = new HashMap<Integer, List<Object>>();
        while ((block = readBlock(mNominalValuesInput)) != ControlBlock.LIST_END)
        {
            if (block != ControlBlock.LIST_BEGIN)
            {
                throw new ActivityUserException(
                        new MalformedListBeginException(INPUT_NOMINAL_VALUES));
            }
            int index = getNextColumnIndex(metadata);
            List<Object> values = new ArrayList<Object>();
            while ((block = readBlock(mNominalValuesInput)) != ControlBlock.LIST_END)
            {
                if (block == ControlBlock.NO_MORE_DATA)
                {
                    throw new ActivityUserException(
                            new MalformedListEndException(INPUT_NOMINAL_VALUES));
                }
                else
                {
                    values.add(block);
                }
            }
            result.put(index, values);
        }
        block = readBlock(mColumnInput); // END outer list of column indices
        if (block != ControlBlock.LIST_END)
        {
            throw new ActivityUserException(
                    new MalformedListEndException(INPUT_COLUMN_INDICES));
        }
        return result;
    }
View Full Code Here

            {
                return index;
            }
            else
            {
                throw new ActivityUserException(
                        new ColumnNotFoundException(index));
            }
        }
        else if (block instanceof String)
        {
            int index = metadata.getColumnMetadataPosition((String)block);
            if (index >= 0)
            {
                return index;
            }
            else
            {
                throw new ActivityUserException(
                        new ColumnNotFoundException((String)block));
            }
        }
        else
        {
View Full Code Here

        {
          classifier = loadClassifier(options);
        }
        catch(InvalidWekaOptionsException exc)
        {
          throw new ActivityUserException(exc);
        }

        try
        {
            classifier.buildClassifier(dataset);
        }
        catch (Exception e)
        {
            throw new ActivityUserException(e);
        }
        try
        {
            TupleClassifier tupleClassifier =
                new TupleClassifier(
View Full Code Here

  private List<String> getColumnNames() throws ActivityUserException, ActivityTerminatedException, ActivityProcessingException{
    List<String> columnNames = new ArrayList<String>();
      Object block = readBlock(mColumnNamesInput); // BEGIN outer list of column indices
      if (block != ControlBlock.LIST_BEGIN)
      {
          throw new ActivityUserException(
                  new MalformedListBeginException(INPUT_COLUMN_NAMES));
      }
     
        while((block = readBlock(mColumnNamesInput)) != ControlBlock.LIST_END) {
          if (!(block instanceof String))
View Full Code Here

  private List<ArrayList<Object>> getValues(List<String> columnNames) throws ActivityUserException, ActivityTerminatedException, ActivityProcessingException{
    List<ArrayList<Object>> result = new ArrayList<ArrayList<Object>>();
      Object block = readBlock(mValuesInput); // BEGIN outer list of column indices
      if (block != ControlBlock.LIST_BEGIN)
      {
          throw new ActivityUserException(
                  new MalformedListBeginException(INPUT_VALUES));
      }
     
      /* Inner sequencs */
        while ((block = readBlock(mValuesInput)) != ControlBlock.LIST_END)
        {
          ArrayList<Object> values = new ArrayList<Object>();
            if (block != ControlBlock.LIST_BEGIN)
            {
                throw new ActivityUserException(
                        new MalformedListBeginException(INPUT_VALUES));
            }

            while ((block = readBlock(mValuesInput)) != ControlBlock.LIST_END)
            {
                if (block == ControlBlock.NO_MORE_DATA)
                {
                    throw new ActivityUserException(
                            new MalformedListEndException(INPUT_VALUES));
                }
                else
                {
                    values.add(block);
View Full Code Here

          options = DEFAULT_OPTIONS;
         
        }
        catch (Exception e)
        {
            throw new ActivityUserException(e);
        }
        try
        {
          Tuple tuple;
       
View Full Code Here

{
    Object block;
    block = readBlock(mNominalValuesInput); // BEGIN outer list of nominal values
    if (block != ControlBlock.LIST_BEGIN)
    {
        throw new ActivityUserException(
                new MalformedListBeginException(INPUT_NOMINAL_VALUES));
    }
    block = readBlock(mColumnInput); // BEGIN outer list of column indices
    if (block != ControlBlock.LIST_BEGIN)
    {
        throw new ActivityUserException(
                new MalformedListBeginException(INPUT_COLUMN_INDICES));
    }
    Map<Integer, List<Object>> result = new HashMap<Integer, List<Object>>();
    while ((block = readBlock(mNominalValuesInput)) != ControlBlock.LIST_END)
    {
        if (block != ControlBlock.LIST_BEGIN)
        {
            throw new ActivityUserException(
                    new MalformedListBeginException(INPUT_NOMINAL_VALUES));
        }
        int index = getNextColumnIndex();
        List<Object> values = new ArrayList<Object>();
        while ((block = readBlock(mNominalValuesInput)) != ControlBlock.LIST_END)
        {
            if (block == ControlBlock.NO_MORE_DATA)
            {
                throw new ActivityUserException(
                        new MalformedListEndException(INPUT_NOMINAL_VALUES));
            }
            else
            {
                values.add(block);
            }
        }
        result.put(index, values);
    }
    block = readBlock(mColumnInput); // END outer list of column indices
    if (block != ControlBlock.LIST_END)
    {
        throw new ActivityUserException(
                new MalformedListEndException(INPUT_COLUMN_INDICES));
    }
    return result;
}
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.activity.ActivityUserException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.