View Javadoc

1   /*
2    *  File: IIntervalRelation.java 
3    *  Copyright (c) 2004-2008  Peter Kliem (Peter.Kliem@jaret.de)
4    *  A commercial license is available, see http://www.jaret.de.
5    *
6    *  This program is free software; you can redistribute it and/or modify
7    *  it under the terms of the GNU General Public License as published by
8    *  the Free Software Foundation; either version 2 of the License, or
9    *  (at your option) any later version.
10   *
11   *  This program is distributed in the hope that it will be useful,
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   *  GNU General Public License for more details.
15   *
16   *  You should have received a copy of the GNU General Public License
17   *  along with this program; if not, write to the Free Software
18   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19   */
20  package de.jaret.util.ui.timebars.model;
21  
22  /**
23   * Relation between intervals.
24   * 
25   * @author kliem
26   * @version $Id: IIntervalRelation.java 800 2008-12-27 22:27:33Z kliem $
27   */
28  public interface IIntervalRelation {
29      /**
30       * Direction of the relation.
31       */
32      enum Direction {
33          /**
34           * Bidirectional.
35           */
36          BI,
37          /**
38           * No specified direction.
39           */
40          NONE,
41          /**
42           * Forward.
43           */
44          FORWARD,
45          /**
46           * Backwards.
47           */
48          BACK
49      };
50  
51      /**
52       * Relation type denoting if the relation should refer to the end or begin of the interval.
53       */
54      enum Type {
55          /**
56           * Begin of first interval to end of second interval.
57           */
58          BEGIN_END,
59          /**
60           * Begin of first interval to begin of second interval.
61           */
62          BEGIN_BEGIN,
63          /**
64           * End of first interval to begin of second interval.
65           */
66          END_BEGIN,
67          /**
68           * End of first interval to end of second interval.
69           */
70          END_END
71      };
72  
73      /** propertyname constant for the direction property. */
74      String DIRECTION = "Direction";
75      /** propertyname constant for the type property. */
76      String TYPE = "Type";
77      /** propertyname constant for the start interval property. */
78      String STARTINTERVAL = "StartInterval";
79      /** propertyname constant for the end interval property. */
80      String ENDINTERVAL = "EndInterval";
81  
82      /**
83       * Retrieve the start interval.
84       * 
85       * @return the start interval
86       */
87      IRelationalInterval getStartInterval();
88  
89      /**
90       * Set the start interval.
91       * 
92       * @param interval the start interval
93       */
94      void setStartInterval(IRelationalInterval interval);
95  
96      /**
97       * Retrieve the end interval.
98       * 
99       * @return the end interval
100      */
101     IRelationalInterval getEndInterval();
102 
103     /**
104      * Set the end interval.
105      * 
106      * @param interval the end interval
107      */
108     void setEndInterval(IRelationalInterval interval);
109 
110     /**
111      * Retrieve the direction of the relation.
112      * 
113      * @return the direction
114      */
115     Direction getDirection();
116 
117     /**
118      * Set the direction of the realtion.
119      * 
120      * @param direction direction
121      */
122     void setDirection(Direction direction);
123 
124     /**
125      * Retrieve the type of the relation.
126      * 
127      * @return the type
128      */
129     Type getType();
130 
131     /**
132      * Set the type of the relation.
133      * 
134      * @param type the type to use
135      */
136     void setType(Type type);
137 
138 }