Imported Upstream version 0.48
[platform/upstream/libical.git] / src / java / ICalTriggerType.java
1 /*======================================================================
2  FILE: ICalTriggerType.java
3  CREATOR: structConverter 01/11/02
4  (C) COPYRIGHT 2002, Critical Path
5 ======================================================================*/
6
7 package net.cp.jlibical;
8
9 /** struct icaltriggertype */
10 public class ICalTriggerType
11 {
12         /**
13          * Constructor for pre-existing native icaltriggertype
14          * @param obj c++ pointer
15          */
16         ICalTriggerType(long obj)
17         {
18                 init(obj);
19         }
20
21         /**
22         * Constructor for pre-existing native icaltriggertype
23         * @param aTime c++ pointer
24         * @param aDuration c++ pointer
25         */
26         ICalTriggerType(long aTime, long aDuration)
27         {
28                 init(aTime, aDuration);
29         }
30
31         /**
32         * Constructor for default ICalTriggerType
33         */
34         public ICalTriggerType()
35         {
36         }
37
38         public void setTime(ICalTimeType lcl_arg0)
39         {
40                 time = lcl_arg0;
41         }
42         public ICalTimeType getTime()
43         {
44                 return time;
45         }
46
47         public void setDuration(ICalDurationType lcl_arg0)
48         {
49                 duration = lcl_arg0;
50         }
51         public ICalDurationType getDuration()
52         {
53                 return duration;
54         }
55
56         // --------------------------------------------------------
57         // Initialization
58         // --------------------------------------------------------
59
60         /**
61         * init with a native object
62         */
63         private void init(long aTime, long aDuration)
64         {
65                 time = new ICalTimeType(aTime);
66                 duration = new ICalDurationType(aDuration);
67         }
68
69         /**
70          * copy data from an existing struct.
71          */
72         private native void init(long obj);
73
74         /**
75         * optimization: init field id cache,
76         */
77         private native static void initFIDs();
78
79         /**
80         * load the jni library for this class
81         */
82         static {
83                 System.loadLibrary("ical_jni");
84                 initFIDs();
85         }
86
87         // --------------------------------------------------------
88         // Fields
89         // --------------------------------------------------------
90         private ICalTimeType            time = new ICalTimeType();
91         private ICalDurationType        duration = new ICalDurationType();
92 }
93