001 /* 002 * Created on Aug 5, 2005 003 * 004 */ 005 package aima.learning.framework; 006 007 /** 008 * @author Ravi Mohan 009 * 010 */ 011 012 public class NumericAttribute implements Attribute { 013 double value; 014 015 private NumericAttributeSpecification spec; 016 017 public NumericAttribute(double rawvalue, NumericAttributeSpecification spec) { 018 this.value = rawvalue; 019 this.spec = spec; 020 } 021 022 public String valueAsString() { 023 return Double.toString(value); 024 } 025 026 public String name() { 027 return spec.getAttributeName().trim(); 028 } 029 030 public double valueAsDouble() { 031 return value; 032 } 033 034 }