-
Notifications
You must be signed in to change notification settings - Fork 227
Expand file tree
/
Copy pathDateFactory.java
More file actions
97 lines (88 loc) · 3.22 KB
/
DateFactory.java
File metadata and controls
97 lines (88 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
* Jython Database Specification API 2.0
*
*
* Copyright (c) 2003 brian zimmer <bzimmer@ziclix.com>
*
*/
package com.ziclix.python.sql;
import org.python.core.PyObject;
/**
* Provide an extensible way to create dates for zxJDBC.
*
* @author brian zimmer
*/
public interface DateFactory {
/**
* This function constructs an object holding a date value.
*
* @param year to set
* @param month to set
* @param day to set
* @return date as PyObject
*/
public PyObject Date(int year, int month, int day);
/**
* This function constructs an object holding a time value.
*
* @param hour to set
* @param minute to set
* @param second to set
* @return time as PyObject
*/
public PyObject Time(int hour, int minute, int second);
/**
* This function constructs an object holding a time stamp value.
*
* @param year to set
* @param month to set
* @param day to set
* @param hour to set
* @param minute to set
* @param second to set
* @return time stamp as PyObject
*/
public PyObject Timestamp(int year, int month, int day, int hour, int minute, int second);
/**
* This function constructs an object holding a date value from the
* given ticks value (number of seconds since the epoch; see the
* documentation of the standard Python <i>time</i> module for details).
* <p>
* <i>Note:</i> The DB API 2.0 spec calls for time in seconds since the epoch
* while the Java Date object returns time in milliseconds since the epoch.
* This module adheres to the python API and will therefore use time in
* seconds rather than milliseconds, so adjust any Java code accordingly.
*
* @param ticks number of seconds since the epoch
* @return PyObject
*/
public PyObject DateFromTicks(long ticks);
/**
* This function constructs an object holding a time value from the
* given ticks value (number of seconds since the epoch; see the
* documentation of the standard Python <i>time</i> module for details).
* <p>
* <i>Note:</i> The DB API 2.0 spec calls for time in seconds since the epoch
* while the Java Date object returns time in milliseconds since the epoch.
* This module adheres to the python API and will therefore use time in
* seconds rather than milliseconds, so adjust any Java code accordingly.
*
* @param ticks number of seconds since the epoch
* @return PyObject
*/
public PyObject TimeFromTicks(long ticks);
/**
* This function constructs an object holding a time stamp value from
* the given ticks value (number of seconds since the epoch; see the
* documentation of the standard Python <i>time</i> module for details).
* <p>
* <i>Note:</i> The DB API 2.0 spec calls for time in seconds since the epoch
* while the Java Date object returns time in milliseconds since the epoch.
* This module adheres to the python API and will therefore use time in
* seconds rather than milliseconds, so adjust any Java code accordingly.
*
* @param ticks number of seconds since the epoch
* @return PyObject
*/
public PyObject TimestampFromTicks(long ticks);
}