KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > schlichtherle > io > ArchiveStatistics


1 /*
2  * ArchiveStatistics.java
3  *
4  * Created on 5. April 2006, 09:48
5  */

6 /*
7  * Copyright 2006 Schlichtherle IT Services
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */

21
22 package de.schlichtherle.io;
23
24 /**
25  * A proxy interface which encapsulates statistics about the total set of
26  * archives operated by this package.
27  * Client applications should never implement this interface; simply because
28  * there is no need to and because this interface may be amended over time.
29  *
30  * @see File#getLiveArchiveStatistics
31  *
32  * @author Christian Schlichtherle
33  * @version @version@
34  * @since TrueZIP 6.0
35  */

36 public interface ArchiveStatistics {
37     
38     /**
39      * Returns the total number of bytes read from all <em>non-enclosed</em>
40      * archive files which are updated during {@link File#update()} or
41      * {@link File#umount()}.
42      * <p>
43      * Please note that this method counts input from top level archive
44      * files which require an update only, i.e. archive files which are
45      * actually updated throughout the course of {@link File#update()} or
46      * {@link File#update()} and are not enclosed in other archive
47      * files and hence are present in the native file system.
48      * <p>
49      * This method is intended to be used for progress monitors and is a rough
50      * indicator about what is going on inside the TrueZIP API.
51      * The return value will be reset automatically where required,
52      * so if this value is going to <code>0</code> again you know that a knew
53      * update cycle has begun.
54      * Other than this, you should not rely on its actual value.
55      * <p>
56      * For an example how to use this please refer to the source
57      * code for <code>nzip.ProgressMonitor</code> in the base package.
58      *
59      * @see File#update
60      * @see File#umount
61      */

62     long getUpdateTotalByteCountRead();
63     
64     /**
65      * Returns the total number of bytes written to all <em>non-enclosed</em>
66      * archive files which are updated during {@link File#update()} or
67      * {@link File#umount()}.
68      * <p>
69      * Please note that this method counts output to top level archive
70      * files which require an update only, i.e. archive files which are
71      * actually updated throughout the course of {@link File#update()} or
72      * {@link File#update()} and are not enclosed in other archive
73      * files and hence are present in the native file system.
74      * <p>
75      * This method is intended to be used for progress monitors and is a rough
76      * indicator about what is going on inside the TrueZIP API.
77      * The return value will be reset automatically where required,
78      * so if this value is going to <code>0</code> again you know that a knew
79      * update cycle has begun.
80      * Other than this, you should not rely on its actual value.
81      * <p>
82      * For an example how to use this please refer to the source
83      * code for <code>nzip.ProgressMonitor</code> in the base package.
84      *
85      * @see File#update
86      * @see File#umount
87      */

88     long getUpdateTotalByteCountWritten();
89
90     /**
91      * Returns the total number of archives operated by this package.
92      */

93     int getArchivesTotal();
94     
95     /**
96      * Returns the number of archives which have been changed and
97      * hence need to be processed on the next call to {@link File#update} or
98      * {@link File#umount}.
99      * Note that you should <em>not</em> use the returned value to call
100      * <code>File.update()</code> or <code>File.umount()</code> only
101      * conditionally - this is unreliable!
102      * Instead, you should always call one of those methods unconditionally.
103      */

104     int getArchivesTouched();
105
106     /**
107      * Returns the total number of top level archives operated by this package.
108      */

109     int getTopLevelArchivesTotal();
110     
111     /**
112      * Returns the number of top level archives which have been changed and
113      * hence need to be processed on the next call to {@link File#update} or
114      * {@link File#umount}.
115      * Note that you should <em>not</em> use the returned value to call
116      * <code>File.update()</code> or <code>File.umount()</code> only
117      * conditionally - this is unreliable!
118      * Instead, you should always call one of those methods unconditionally.
119      */

120     int getTopLevelArchivesTouched();
121 }
122
Popular Tags