com.exponto.jstock.io
Class Util

java.lang.Object
  extended bycom.exponto.jstock.io.Util

public abstract class Util
extends java.lang.Object

Some static methods that are more or less usefull.

Author:
kaare

Constructor Summary
Util()
           
 
Method Summary
static LogTradingData convertString(java.lang.String str)
          Converts a string to LogTradingData
static LogTradingData convertYahooString(java.lang.String str)
           
static boolean evalute(java.lang.Object[] rule, LogTradingData lTD)
           
static java.lang.String findSubString(java.lang.String s, int i)
          Find a substring in tab, comma or space separated string.
static boolean validate(LogDataSeries lDS)
          Validates that a data series is likly to be correct
static char validate(LogTradingData lTD)
          Validate that the given combination of open, high, low, close and volume values are likely to correct.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

convertString

public static LogTradingData convertString(java.lang.String str)
Converts a string to LogTradingData

Parameters:
str - that includes all needed data for a day
Returns:
Logtradingdata for the day

convertYahooString

public static LogTradingData convertYahooString(java.lang.String str)

validate

public static char validate(LogTradingData lTD)
Validate that the given combination of open, high, low, close and volume values are likely to correct. Tests and results: If all zero -> assumes that stock is not traded volume zero, but others not -> faulty low > high -> faulty !high >= open >= low -> faulty !high >= close >= low -> faulty if high > 3* low -> drop otherwise -> ok Note that data will be marked as "drop" if high > 3 * low If only open and close is available either set high and low to the higher/lower of opne /close or modify the tests

Returns:
char Result of verification

validate

public static boolean validate(LogDataSeries lDS)
Validates that a data series is likly to be correct

Parameters:
lDS - The LogDataSeries to be validated
Returns:
true if the data MIGHT be corect

findSubString

public static java.lang.String findSubString(java.lang.String s,
                                             int i)
Find a substring in tab, comma or space separated string. 0 is first substring

Returns:
the substring that is found.

evalute

public static boolean evalute(java.lang.Object[] rule,
                              LogTradingData lTD)


Copyright © 2004 Kaare Ranum