tauZaman
v0.1

tauzaman.field.fvsupport
Class FVSupport

java.lang.Object
  |
  +--tauzaman.field.fvsupport.FVSupport
Direct Known Subclasses:
FVFunction, FVTable

public abstract class FVSupport
extends java.lang.Object

FVSupport abstrat class represents a generic field value support information, that provides two basic functionality when converting temporal constant strings to timestamps or vice versa.

One of them is called indexToString, which converts indices, such as 1, to corresponding string, such as January in english month names. The other functionality is called stringToIndex, and it does opposite of what indexToString does. Given January, for example, it converts it to corresponding index, which is 1 in again english month names.

This class is used as a base class for FVTable and FVFunction classes.

Status:
design complete, implementation complete

Field Summary
protected  java.lang.String regex
          regex for this structure, that will be used to parse input string
protected  java.net.URL url
          url of this structure, which contains actual conversion informatio
 
Constructor Summary
FVSupport()
           
 
Method Summary
 java.lang.String getRegex()
          Returns regex for this field value if it exists.
 java.net.URL getUrl()
          Returns url for this field value if it exists.
abstract  java.lang.String indexToString(long index)
          Converts a given long to corresponding string.
abstract  long stringToIndex(java.lang.String string)
          Converts a given string to corresponding index.
abstract  java.lang.String toString()
          Returns a String representation of this FVSupport.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

url

protected java.net.URL url
url of this structure, which contains actual conversion informatio


regex

protected java.lang.String regex
regex for this structure, that will be used to parse input string

Constructor Detail

FVSupport

public FVSupport()
Method Detail

stringToIndex

public abstract long stringToIndex(java.lang.String string)
                            throws FVServiceException
Converts a given string to corresponding index.
 Given January for Gregorian calendar and using 
 a table called "EnglishMonthNames", this method returns
 1 as the index of January.
 

Parameters:
string - string representation of input
Returns:
long index corresponding of string
Throws:
FVServiceException - if any problem occurs during process of this field value support method
See Also:
FVTable.indexToString(long), FVFunction.indexToString(long)

indexToString

public abstract java.lang.String indexToString(long index)
                                        throws FVServiceException
Converts a given long to corresponding string.
 Given 1 for Gregorian calendar and using 
 a table called "EnglishMonthNames", this method returns
 January as the string corresponding of 1.
 

Parameters:
index - long representation of input
Returns:
String string corresponding of long index
Throws:
FVServiceException - if any problem occurs during process of this field value support method
See Also:
FVTable.stringToIndex(java.lang.String), FVFunction.stringToIndex(java.lang.String)

getRegex

public java.lang.String getRegex()
Returns regex for this field value if it exists. If it does not exists default regex, which is defined in Calendric System Specification file, will be used.

Returns:
String regular expression defined for this FVsupport

getUrl

public java.net.URL getUrl()
Returns url for this field value if it exists.

Returns:
URL url of this FVsupport

toString

public abstract java.lang.String toString()
Returns a String representation of this FVSupport. String is formed with the label and url of this FVSupport

Overrides:
toString in class java.lang.Object
Returns:
a String representing this FVSupport

tauZaman
v0.1

Submit a bug or feature

tauZaman is an open-source, publicly avaliable project