uk.ac.starlink.table.formats
Class RowEvaluator.Decoder

java.lang.Object
  extended by uk.ac.starlink.table.formats.RowEvaluator.Decoder
Enclosing class:
RowEvaluator

public abstract static class RowEvaluator.Decoder
extends Object

Interface for an object that can turn a string into a cell content object.


Constructor Summary
RowEvaluator.Decoder(Class clazz)
          Constructor.
 
Method Summary
 ColumnInfo createColumnInfo(String name)
          Returns a new ColumnInfo suitable for the decoded values.
abstract  Object decode(String value)
          Decodes a value.
abstract  boolean isValid(String value)
          Indicates whether this decoder is capable of decoding a given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowEvaluator.Decoder

public RowEvaluator.Decoder(Class clazz)
Constructor.

Parameters:
clazz - class of object to be returned by decode method
Method Detail

createColumnInfo

public ColumnInfo createColumnInfo(String name)
Returns a new ColumnInfo suitable for the decoded values.

Parameters:
name - column name
Returns:
new metadata object

decode

public abstract Object decode(String value)
Decodes a value. Will complete without exception if isValid(java.lang.String) returns true for the presented value; otherwise may throw an unchecked exception.

Parameters:
value - string to decode
Returns:
typed object corresponding to value

isValid

public abstract boolean isValid(String value)
Indicates whether this decoder is capable of decoding a given string.

Parameters:
value - string to decode
Returns:
true iff this decoder can make sense of the string

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.