View Javadoc
1   package info.mikethomas.fahview.v6project.model;
2   
3   /*
4    * #%L
5    * This file is part of FAHView-v6project.
6    * %%
7    * Copyright (C) 2011 - 2017 Mike Thomas <mikepthomas@outlook.com>
8    * %%
9    * FAHView is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as published by
11   * the Free Software Foundation, either version 3 of the License, or
12   * (at your option) any later version.
13   * %
14   * FAHView is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * %
19   * You should have received a copy of the GNU General Public License
20   * along with FAHView.  If not, see <http://www.gnu.org/licenses/>.
21   * #L%
22   */
23  
24  import java.util.Date;
25  
26  /**
27   * Interface to represent data stored about a Folding@home work unit.
28   *
29   * @author <a href="mailto:mikepthomas@outlook.com">Michael Thomas</a>
30   * @version 6.00
31   */
32  public interface WorkUnit {
33      // <editor-fold defaultstate="collapsed" desc="position-constants">
34      /**
35       * Position in bytes of the Project Number from the start of
36       * {@code queue.dat}.
37       *
38       * @see #getProj()
39       * @see #PROJ_LENGTH
40       */
41      int PROJ_POS = 0;
42      /**
43       * Position in bytes of the Run Number from the start of
44       * {@code queue.dat}.
45       *
46       * @see #getRun()
47       * @see #RUN_LENGTH
48       */
49      int RUN_POS = 2;
50      /**
51       * Position in bytes of the Clone Number from the start of
52       * {@code queue.dat}.
53       *
54       * @see #getClone()
55       * @see #CLONE_LENGTH
56       */
57      int CLONE_POS = 4;
58      /**
59       * Position in bytes of the Generation Number from the start of
60       * {@code queue.dat}.
61       *
62       * @see #getGen()
63       * @see #GEN_LENGTH
64       */
65      int GEN_POS = 6;
66      /**
67       * Position in bytes of the Issued date from the start of
68       * {@code queue.dat}.
69       *
70       * @see #getIssue()
71       * @see #ISSUE_LENGTH
72       */
73      int ISSUE_POS = 8;
74      // </editor-fold>
75      // <editor-fold defaultstate="collapsed" desc="length-constants">
76      /**
77       * Length in bytes of the Project Number in {@code queue.dat}.
78       *
79       * @see #getProj()
80       * @see #PROJ_POS
81       */
82      int PROJ_LENGTH = 2;
83      /**
84       * Length in bytes of the Run Number in {@code queue.dat}.
85       *
86       * @see #getRun()
87       * @see #RUN_POS
88       */
89      int RUN_LENGTH = 2;
90      /**
91       * Length in bytes of the Clone Number in {@code queue.dat}.
92       *
93       * @see #getClone()
94       * @see #CLONE_POS
95       */
96      int CLONE_LENGTH = 2;
97      /**
98       * Length in bytes of the Generation Number in {@code queue.dat}.
99       *
100      * @see #getGen()
101      * @see #GEN_POS
102      */
103     int GEN_LENGTH = 2;
104     /**
105      * Length in bytes of the Issued date in {@code queue.dat}.
106      *
107      * @see #getIssue()
108      * @see #ISSUE_POS
109      */
110     int ISSUE_LENGTH = 8;
111     // </editor-fold>
112     // <editor-fold desc="accessors">
113     /**
114      * Get the value of the Project Number.
115      *
116      * @return the value of proj
117      */
118     int getProj();
119 
120     /**
121      * Get the value of Run.
122      *
123      * @return the value of run
124      */
125     int getRun();
126 
127     /**
128      * Get the value of Clone.
129      *
130      * @return the value of clone
131      */
132     int getClone();
133 
134     /**
135      * Get the value of Generation.
136      *
137      * @return the value of gen
138      */
139     int getGen();
140 
141     /**
142      * Get the value of Issued.
143      *
144      * @return the value of issue
145      */
146     Date getIssue();
147     // </editor-fold>
148 
149     /**
150      * Update all values.
151      */
152     void update();
153 }