/** 
 * Copyright (c) 2012, Regents of the University of Colorado 
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 
 * Neither the name of the University of Colorado at Boulder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE. 
 */
package org.cleartk.classifier.feature.transform;

import java.util.List;

import org.cleartk.classifier.Feature;

/**
 * Abstract base class for transformable features.
 * <P>
 * 
 * <br>
 * Copyright (c) 2012, Regents of the University of Colorado <br>
 * All rights reserved.
 * 
 * @author Lee Becker
 * 
 */
public class TransformableFeature extends Feature {

  /**
   * 
   */
  private static final long serialVersionUID = 1L;

  protected List<Feature> features;

  // Following are unsupported to prevent anything but InstanceDataWriter from writing transformable
  // features.
  @Override
  public Object getValue() {
    throw new UnsupportedOperationException();
  }

  @Override
  public void setValue(Object value) {
    throw new UnsupportedOperationException();
  }

  @Override
  public String getName() {
    throw new UnsupportedOperationException();
  }

  @Override
  public void setName(String name) {
    throw new UnsupportedOperationException();
  }

  public List<Feature> getFeatures() {
    return this.features;
  }

}

@@ -2056,16 +2056,394 @@
 tures;%0A%0A
+  private static final String UNSUPPORTED_OPERATION_EXCEPTION_MESSAGE = %22This is a temporary %22%0A      + %22place-holder feature that cannot be written by most data writers. Instead, it must be %22%0A      + %22written with an %22 + InstanceDataWriter.class.getName() + %22and then the instances should%22%0A      + %22be transformed by the appropriate %22 + TrainableFromInstances.class.getName();%0A%0A
   // Fol
@@ -2627,32 +2627,71 @@
 rationException(
+UNSUPPORTED_OPERATION_EXCEPTION_MESSAGE
 );%0A  %7D%0A%0A  @Overr
@@ -2769,32 +2769,71 @@
 rationException(
+UNSUPPORTED_OPERATION_EXCEPTION_MESSAGE
 );%0A  %7D%0A%0A  @Overr
@@ -2900,32 +2900,71 @@
 rationException(
+UNSUPPORTED_OPERATION_EXCEPTION_MESSAGE
 );%0A  %7D%0A%0A  @Overr
@@ -3048,16 +3048,55 @@
 ception(
+UNSUPPORTED_OPERATION_EXCEPTION_MESSAGE
 );%0A  %7D%0A%0A

Give a more informative message when a transformable feature is used inappropriately.