// Path: src/main/java/net/ucanaccess/converters/TypesMap.java
// public static enum AccessType{
// 		BYTE,
// 		COUNTER,
// 		CURRENCY, 
// 		DATETIME,
// 		DOUBLE,
// 		GUID,
// 		INTEGER,
// 		LONG,
// 		MEMO, 
// 		NUMERIC,
// 		OLE,
// 		SINGLE,
// 		TEXT,
// 		YESNO
// }
// 
// Path: src/main/java/net/ucanaccess/jdbc/UcanaccessSQLException.java
// public class UcanaccessSQLException extends SQLException {
// 	public enum ExceptionMessages{
// 		CONCURRENT_PROCESS_ACCESS,
// 		INVALID_CREATE_STATEMENT,
// 		INVALID_INTERVAL_VALUE,
// 		INVALID_JACKCESS_OPENER,
// 		INVALID_MONTH_NUMBER, 
// 		NOT_A_VALID_PASSWORD, 
// 		ONLY_IN_MEMORY_ALLOWED, 
// 		UNPARSABLE_DATE,
// 		COMPLEX_TYPE_UNSUPPORTED, 
// 		INVALID_PARAMETER,
// 		INVALID_TYPES_IN_COMBINATION,
// 		UNSUPPORTED_TYPE
// 	}
// 	private static final long serialVersionUID = -1432048647665807662L;
// 	private Throwable cause;
// 	public UcanaccessSQLException() {
// 	}
// 	
// 	public UcanaccessSQLException(ExceptionMessages reason) {
// 		super(Logger.getMessage(reason.name()));
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String SQLState) {
// 		super(Logger.getMessage(reason), SQLState);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String SQLState, int vendorCode) {
// 		super(Logger.getMessage(reason), SQLState, vendorCode);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String sqlState,
// 			int vendorCode, Throwable cause) {
// 		super(Logger.getMessage(reason), sqlState, vendorCode, cause);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String sqlState, Throwable cause) {
// 		super(Logger.getMessage(reason), sqlState, cause);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, Throwable cause) {
// 		super(Logger.getMessage(reason), cause);
// 	}
// 	
// 	public UcanaccessSQLException(Throwable cause) {
// 		super( explaneCause(cause));
// 		this.cause=cause;
// 	}
// 	
// 	public static String explaneCause(Throwable cause){
// 		if(cause instanceof SQLException){
// 			SQLException se=(SQLException)cause;
// 			if(se.getErrorCode()==-5562){
// 				return cause.getMessage()+" "+Logger.getMessage(ExceptionMessages.INVALID_TYPES_IN_COMBINATION.name());
// 			}
// 		}
// 		return cause.getMessage();
// 	}
// 
// 	public Throwable getCause() {
// 		return this.cause;
// 	}
// }
// 
// Path: src/main/java/net/ucanaccess/jdbc/UcanaccessSQLException.java
// public enum ExceptionMessages{
// 	CONCURRENT_PROCESS_ACCESS,
// 	INVALID_CREATE_STATEMENT,
// 	INVALID_INTERVAL_VALUE,
// 	INVALID_JACKCESS_OPENER,
// 	INVALID_MONTH_NUMBER, 
// 	NOT_A_VALID_PASSWORD, 
// 	ONLY_IN_MEMORY_ALLOWED, 
// 	UNPARSABLE_DATE,
// 	COMPLEX_TYPE_UNSUPPORTED, 
// 	INVALID_PARAMETER,
// 	INVALID_TYPES_IN_COMBINATION,
// 	UNSUPPORTED_TYPE
// }


import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import net.ucanaccess.converters.TypesMap.AccessType;
import net.ucanaccess.ext.FunctionType;
import net.ucanaccess.jdbc.UcanaccessSQLException;
import net.ucanaccess.jdbc.UcanaccessSQLException.ExceptionMessages;
import java.math.BigDecimal;
import java.math.MathContext;
import java.sql.Timestamp;
import java.text.DateFormatSymbols;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.ParseException;
import java.text.SimpleDateFormat;
/*
Copyright (c) 2012 Marco Amadei.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
USA

You can contact Marco Amadei at amadei.mar@gmail.com.

 */
package net.ucanaccess.converters;




public class Functions {
	private static Double rnd;
	private static Double lastRnd;
	public final static SimpleDateFormat[] SDFA = new SimpleDateFormat[] {
			new SimpleDateFormat("MMM dd,yyyy"),
			new SimpleDateFormat("MM dd,yyyy"),
			new SimpleDateFormat("MM/dd/yyyy"),
			new SimpleDateFormat("MMM dd hh:mm:ss"),
			new SimpleDateFormat("MM dd hh:mm:ss"),
			new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"),
			new SimpleDateFormat("yyyy-MM-dd"),
			new SimpleDateFormat("MM/dd/yyyy hh:mm:ss") };
	public static final SimpleDateFormat SDFBB = new SimpleDateFormat(
			"yyyy-MM-dd");

// Path: src/main/java/net/ucanaccess/converters/TypesMap.java
// public static enum AccessType{
// 		BYTE,
// 		COUNTER,
// 		CURRENCY, 
// 		DATETIME,
// 		DOUBLE,
// 		GUID,
// 		INTEGER,
// 		LONG,
// 		MEMO, 
// 		NUMERIC,
// 		OLE,
// 		SINGLE,
// 		TEXT,
// 		YESNO
// }
// 
// Path: src/main/java/net/ucanaccess/jdbc/UcanaccessSQLException.java
// public class UcanaccessSQLException extends SQLException {
// 	public enum ExceptionMessages{
// 		CONCURRENT_PROCESS_ACCESS,
// 		INVALID_CREATE_STATEMENT,
// 		INVALID_INTERVAL_VALUE,
// 		INVALID_JACKCESS_OPENER,
// 		INVALID_MONTH_NUMBER, 
// 		NOT_A_VALID_PASSWORD, 
// 		ONLY_IN_MEMORY_ALLOWED, 
// 		UNPARSABLE_DATE,
// 		COMPLEX_TYPE_UNSUPPORTED, 
// 		INVALID_PARAMETER,
// 		INVALID_TYPES_IN_COMBINATION,
// 		UNSUPPORTED_TYPE
// 	}
// 	private static final long serialVersionUID = -1432048647665807662L;
// 	private Throwable cause;
// 	public UcanaccessSQLException() {
// 	}
// 	
// 	public UcanaccessSQLException(ExceptionMessages reason) {
// 		super(Logger.getMessage(reason.name()));
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String SQLState) {
// 		super(Logger.getMessage(reason), SQLState);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String SQLState, int vendorCode) {
// 		super(Logger.getMessage(reason), SQLState, vendorCode);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String sqlState,
// 			int vendorCode, Throwable cause) {
// 		super(Logger.getMessage(reason), sqlState, vendorCode, cause);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String sqlState, Throwable cause) {
// 		super(Logger.getMessage(reason), sqlState, cause);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, Throwable cause) {
// 		super(Logger.getMessage(reason), cause);
// 	}
// 	
// 	public UcanaccessSQLException(Throwable cause) {
// 		super( explaneCause(cause));
// 		this.cause=cause;
// 	}
// 	
// 	public static String explaneCause(Throwable cause){
// 		if(cause instanceof SQLException){
// 			SQLException se=(SQLException)cause;
// 			if(se.getErrorCode()==-5562){
// 				return cause.getMessage()+" "+Logger.getMessage(ExceptionMessages.INVALID_TYPES_IN_COMBINATION.name());
// 			}
// 		}
// 		return cause.getMessage();
// 	}
// 
// 	public Throwable getCause() {
// 		return this.cause;
// 	}
// }
// 
// Path: src/main/java/net/ucanaccess/jdbc/UcanaccessSQLException.java
// public enum ExceptionMessages{
// 	CONCURRENT_PROCESS_ACCESS,
// 	INVALID_CREATE_STATEMENT,
// 	INVALID_INTERVAL_VALUE,
// 	INVALID_JACKCESS_OPENER,
// 	INVALID_MONTH_NUMBER, 
// 	NOT_A_VALID_PASSWORD, 
// 	ONLY_IN_MEMORY_ALLOWED, 
// 	UNPARSABLE_DATE,
// 	COMPLEX_TYPE_UNSUPPORTED, 
// 	INVALID_PARAMETER,
// 	INVALID_TYPES_IN_COMBINATION,
// 	UNSUPPORTED_TYPE
// }


// Path: src/main/java/net/ucanaccess/converters/Functions.java
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import net.ucanaccess.converters.TypesMap.AccessType;
import net.ucanaccess.ext.FunctionType;
import net.ucanaccess.jdbc.UcanaccessSQLException;
import net.ucanaccess.jdbc.UcanaccessSQLException.ExceptionMessages;
import java.math.BigDecimal;
import java.math.MathContext;
import java.sql.Timestamp;
import java.text.DateFormatSymbols;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.ParseException;
import java.text.SimpleDateFormat;

/*
Copyright (c) 2012 Marco Amadei.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
USA

You can contact Marco Amadei at amadei.mar@gmail.com.

 */
package net.ucanaccess.converters;




public class Functions {
	private static Double rnd;
	private static Double lastRnd;
	public final static SimpleDateFormat[] SDFA = new SimpleDateFormat[] {
			new SimpleDateFormat("MMM dd,yyyy"),
			new SimpleDateFormat("MM dd,yyyy"),
			new SimpleDateFormat("MM/dd/yyyy"),
			new SimpleDateFormat("MMM dd hh:mm:ss"),
			new SimpleDateFormat("MM dd hh:mm:ss"),
			new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"),
			new SimpleDateFormat("yyyy-MM-dd"),
			new SimpleDateFormat("MM/dd/yyyy hh:mm:ss") };
	public static final SimpleDateFormat SDFBB = new SimpleDateFormat(
			"yyyy-MM-dd");

	@FunctionType(functionName = "ASC", argumentTypes = { AccessType.MEMO }, returnType = AccessType.LONG)