class ValueMetaBase implements IValueMeta {

  @Override
  public BigDecimal getBigNumber( Object object ) throws HopValueException {
    try {
      if ( isNull( object ) ) {
        return null;
      }
      switch ( type ) {
        case TYPE_BIGNUMBER:
          switch ( storageType ) {
            case STORAGE_TYPE_NORMAL:
              return (BigDecimal) object;
            case STORAGE_TYPE_BINARY_STRING:
              return (BigDecimal) convertBinaryStringToNativeType( (byte[]) object );
            case STORAGE_TYPE_INDEXED:
              return (BigDecimal) index[ ( (Integer) object ).intValue() ];
            default:
              throw new HopValueException( toString() + " : Unknown storage type " + storageType + " specified." );
          }
        case TYPE_STRING:
          switch ( storageType ) {
            case STORAGE_TYPE_NORMAL:
              return convertStringToBigNumber( (String) object );
            case STORAGE_TYPE_BINARY_STRING:
              return convertStringToBigNumber( (String) convertBinaryStringToNativeType( (byte[]) object ) );
            case STORAGE_TYPE_INDEXED:
              return convertStringToBigNumber( (String) index[ ( (Integer) object ).intValue() ] );
            default:
              throw new HopValueException( toString() + " : Unknown storage type " + storageType + " specified." );
          }
        case TYPE_INTEGER:
          switch ( storageType ) {
            case STORAGE_TYPE_NORMAL:
              return BigDecimal.valueOf( ( (Long) object ).longValue() );
            case STORAGE_TYPE_BINARY_STRING:
              return BigDecimal.valueOf( ( (Long) convertBinaryStringToNativeType( (byte[]) object ) ).longValue() );
            case STORAGE_TYPE_INDEXED:
              return BigDecimal.valueOf( ( (Long) index[ ( (Integer) object ).intValue() ] ).longValue() );
            default:
              throw new HopValueException( toString() + " : Unknown storage type " + storageType + " specified." );
          }
        case TYPE_NUMBER:
          switch ( storageType ) {
            case STORAGE_TYPE_NORMAL:
              return BigDecimal.valueOf( ( (Double) object ).doubleValue() );
            case STORAGE_TYPE_BINARY_STRING:
              return BigDecimal.valueOf( ( (Double) convertBinaryStringToNativeType( (byte[]) object ) ).doubleValue() );
            case STORAGE_TYPE_INDEXED:
              return BigDecimal.valueOf( ( (Double) index[ ( (Integer) object ).intValue() ] ).doubleValue() );
            default:
              throw new HopValueException( toString() + " : Unknown storage type " + storageType + " specified." );
          }
        case TYPE_DATE:
          switch ( storageType ) {
            case STORAGE_TYPE_NORMAL:
              return convertDateToBigNumber( (Date) object );
            case STORAGE_TYPE_BINARY_STRING:
              return convertDateToBigNumber( (Date) convertBinaryStringToNativeType( (byte[]) object ) );
            case STORAGE_TYPE_INDEXED:
              return convertDateToBigNumber( (Date) index[ ( (Integer) object ).intValue() ] );
            default:
              throw new HopValueException( toString() + " : Unknown storage type " + storageType + " specified." );
          }
        case TYPE_BOOLEAN:
          switch ( storageType ) {
            case STORAGE_TYPE_NORMAL:
              return convertBooleanToBigNumber( (Boolean) object );
            case STORAGE_TYPE_BINARY_STRING:
              return convertBooleanToBigNumber( (Boolean) convertBinaryStringToNativeType( (byte[]) object ) );
            case STORAGE_TYPE_INDEXED:
              return convertBooleanToBigNumber( (Boolean) index[ ( (Integer) object ).intValue() ] );
            default:
              throw new HopValueException( toString() + " : Unknown storage type " + storageType + " specified." );
          }
        case TYPE_BINARY:
          throw new HopValueException( toString() + " : I don't know how to convert binary values to BigDecimals." );
        case TYPE_SERIALIZABLE:
          throw new HopValueException( toString() + " : I don't know how to convert serializable values to BigDecimals." );
        default:
          throw new HopValueException( toString() + " : Unknown type " + type + " specified." );
      }
    } catch ( Exception e ) {
      throw new HopValueException( "Unexpected conversion error while converting value [" + toString()
        + "] to a BigNumber", e );
    }
  }

  public  ValueMetaBase();
  public  ValueMetaBase( String name );
  public  ValueMetaBase( String name, int type );
  public  ValueMetaBase( String name, int type, Comparator<Object> comparator );
  public  ValueMetaBase( String name, int type, int length, int precision );
  public  ValueMetaBase( String name, int type, int length, int precision, Comparator<Object> comparator );
  public  ValueMetaBase( Node node );
  @Deprecated public  ValueMetaBase( DataInputStream inputStream );

}