Skip to content

Commit ca268f4

Browse files
committed
Formatting
1 parent 946797f commit ca268f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+349
-451
lines changed

library/src/com/nostra13/universalimageloader/cache/disc/BaseDiscCache.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@
1515
*******************************************************************************/
1616
package com.nostra13.universalimageloader.cache.disc;
1717

18-
import java.io.File;
19-
2018
import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator;
2119
import com.nostra13.universalimageloader.core.DefaultConfigurationFactory;
2220

21+
import java.io.File;
22+
2323
/**
2424
* Base disc cache. Implements common functionality for disc cache.
25-
*
25+
*
2626
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
27-
* @since 1.0.0
2827
* @see DiscCacheAware
2928
* @see FileNameGenerator
29+
* @since 1.0.0
3030
*/
3131
public abstract class BaseDiscCache implements DiscCacheAware {
3232

library/src/com/nostra13/universalimageloader/cache/disc/DiscCacheAware.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/**
2121
* Interface for disc cache
22-
*
22+
*
2323
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
2424
* @since 1.0.0
2525
*/

library/src/com/nostra13/universalimageloader/cache/disc/LimitedDiscCache.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*******************************************************************************/
1616
package com.nostra13.universalimageloader.cache.disc;
1717

18+
import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator;
19+
import com.nostra13.universalimageloader.core.DefaultConfigurationFactory;
20+
1821
import java.io.File;
1922
import java.util.Collections;
2023
import java.util.HashMap;
@@ -23,17 +26,14 @@
2326
import java.util.Set;
2427
import java.util.concurrent.atomic.AtomicInteger;
2528

26-
import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator;
27-
import com.nostra13.universalimageloader.core.DefaultConfigurationFactory;
28-
2929
/**
3030
* Abstract disc cache limited by some parameter. If cache exceeds specified limit then file with the most oldest last
3131
* usage date will be deleted.
3232
*
3333
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
34-
* @since 1.0.0
3534
* @see BaseDiscCache
3635
* @see FileNameGenerator
36+
* @since 1.0.0
3737
*/
3838
public abstract class LimitedDiscCache extends BaseDiscCache {
3939

@@ -46,21 +46,21 @@ public abstract class LimitedDiscCache extends BaseDiscCache {
4646
private final Map<File, Long> lastUsageDates = Collections.synchronizedMap(new HashMap<File, Long>());
4747

4848
/**
49-
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
50-
* needed for right cache limit work.
49+
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
50+
* needed for right cache limit work.
5151
* @param sizeLimit Cache limit value. If cache exceeds this limit then file with the most oldest last usage date
52-
* will be deleted.
52+
* will be deleted.
5353
*/
5454
public LimitedDiscCache(File cacheDir, int sizeLimit) {
5555
this(cacheDir, DefaultConfigurationFactory.createFileNameGenerator(), sizeLimit);
5656
}
5757

5858
/**
59-
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
60-
* needed for right cache limit work.
59+
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
60+
* needed for right cache limit work.
6161
* @param fileNameGenerator Name generator for cached files
62-
* @param sizeLimit Cache limit value. If cache exceeds this limit then file with the most oldest last usage date
63-
* will be deleted.
62+
* @param sizeLimit Cache limit value. If cache exceeds this limit then file with the most oldest last usage date
63+
* will be deleted.
6464
*/
6565
public LimitedDiscCache(File cacheDir, FileNameGenerator fileNameGenerator, int sizeLimit) {
6666
super(cacheDir, fileNameGenerator);

library/src/com/nostra13/universalimageloader/cache/disc/impl/FileCountLimitedDiscCache.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,37 @@
1515
*******************************************************************************/
1616
package com.nostra13.universalimageloader.cache.disc.impl;
1717

18-
import java.io.File;
19-
2018
import com.nostra13.universalimageloader.cache.disc.LimitedDiscCache;
2119
import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator;
2220
import com.nostra13.universalimageloader.core.DefaultConfigurationFactory;
2321

22+
import java.io.File;
23+
2424
/**
2525
* Disc cache limited by file count. If file count in cache directory exceeds specified limit then file with the most
2626
* oldest last usage date will be deleted.
27-
*
27+
*
2828
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
29-
* @since 1.0.0
3029
* @see LimitedDiscCache
30+
* @since 1.0.0
3131
*/
3232
public class FileCountLimitedDiscCache extends LimitedDiscCache {
3333
/**
34-
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
35-
* needed for right cache limit work.
34+
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
35+
* needed for right cache limit work.
3636
* @param maxFileCount Maximum file count for cache. If file count in cache directory exceeds this limit then file
37-
* with the most oldest last usage date will be deleted.
37+
* with the most oldest last usage date will be deleted.
3838
*/
3939
public FileCountLimitedDiscCache(File cacheDir, int maxFileCount) {
4040
this(cacheDir, DefaultConfigurationFactory.createFileNameGenerator(), maxFileCount);
4141
}
4242

4343
/**
44-
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
45-
* needed for right cache limit work.
44+
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
45+
* needed for right cache limit work.
4646
* @param fileNameGenerator Name generator for cached files
47-
* @param maxFileCount Maximum file count for cache. If file count in cache directory exceeds this limit then file
48-
* with the most oldest last usage date will be deleted.
47+
* @param maxFileCount Maximum file count for cache. If file count in cache directory exceeds this limit then file
48+
* with the most oldest last usage date will be deleted.
4949
*/
5050
public FileCountLimitedDiscCache(File cacheDir, FileNameGenerator fileNameGenerator, int maxFileCount) {
5151
super(cacheDir, fileNameGenerator, maxFileCount);

library/src/com/nostra13/universalimageloader/cache/disc/impl/LimitedAgeDiscCache.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@
1515
*******************************************************************************/
1616
package com.nostra13.universalimageloader.cache.disc.impl;
1717

18+
import com.nostra13.universalimageloader.cache.disc.BaseDiscCache;
19+
import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator;
20+
import com.nostra13.universalimageloader.core.DefaultConfigurationFactory;
21+
1822
import java.io.File;
1923
import java.util.Collections;
2024
import java.util.HashMap;
2125
import java.util.Map;
2226

23-
import com.nostra13.universalimageloader.cache.disc.BaseDiscCache;
24-
import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator;
25-
import com.nostra13.universalimageloader.core.DefaultConfigurationFactory;
26-
2727
/**
2828
* Cache which deletes files which were loaded more than defined time. Cache size is unlimited.
29-
*
29+
*
3030
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
31-
* @since 1.3.1
3231
* @see BaseDiscCache
32+
* @since 1.3.1
3333
*/
3434
public class LimitedAgeDiscCache extends BaseDiscCache {
3535

@@ -39,18 +39,18 @@ public class LimitedAgeDiscCache extends BaseDiscCache {
3939

4040
/**
4141
* @param cacheDir Directory for file caching
42-
* @param maxAge Max file age (in seconds). If file age will exceed this value then it'll be removed on next
43-
* treatment (and therefore be reloaded).
42+
* @param maxAge Max file age (in seconds). If file age will exceed this value then it'll be removed on next
43+
* treatment (and therefore be reloaded).
4444
*/
4545
public LimitedAgeDiscCache(File cacheDir, long maxAge) {
4646
this(cacheDir, DefaultConfigurationFactory.createFileNameGenerator(), maxAge);
4747
}
4848

4949
/**
50-
* @param cacheDir Directory for file caching
50+
* @param cacheDir Directory for file caching
5151
* @param fileNameGenerator Name generator for cached files
52-
* @param maxAge Max file age (in seconds). If file age will exceed this value then it'll be removed on next
53-
* treatment (and therefore be reloaded).
52+
* @param maxAge Max file age (in seconds). If file age will exceed this value then it'll be removed on next
53+
* treatment (and therefore be reloaded).
5454
*/
5555
public LimitedAgeDiscCache(File cacheDir, FileNameGenerator fileNameGenerator, long maxAge) {
5656
super(cacheDir, fileNameGenerator);

library/src/com/nostra13/universalimageloader/cache/disc/impl/TotalSizeLimitedDiscCache.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,42 @@
1515
*******************************************************************************/
1616
package com.nostra13.universalimageloader.cache.disc.impl;
1717

18-
import java.io.File;
19-
2018
import com.nostra13.universalimageloader.cache.disc.LimitedDiscCache;
2119
import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator;
2220
import com.nostra13.universalimageloader.core.DefaultConfigurationFactory;
2321
import com.nostra13.universalimageloader.utils.L;
2422

23+
import java.io.File;
24+
2525
/**
2626
* Disc cache limited by total cache size. If cache size exceeds specified limit then file with the most oldest last
2727
* usage date will be deleted.
28-
*
28+
*
2929
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
30-
* @since 1.0.0
3130
* @see LimitedDiscCache
31+
* @since 1.0.0
3232
*/
3333
public class TotalSizeLimitedDiscCache extends LimitedDiscCache {
3434

3535
private static final int MIN_NORMAL_CACHE_SIZE_IN_MB = 2;
3636
private static final int MIN_NORMAL_CACHE_SIZE = MIN_NORMAL_CACHE_SIZE_IN_MB * 1024 * 1024;
3737

3838
/**
39-
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
40-
* needed for right cache limit work.
39+
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
40+
* needed for right cache limit work.
4141
* @param maxCacheSize Maximum cache directory size (in bytes). If cache size exceeds this limit then file with the
42-
* most oldest last usage date will be deleted.
42+
* most oldest last usage date will be deleted.
4343
*/
4444
public TotalSizeLimitedDiscCache(File cacheDir, int maxCacheSize) {
4545
this(cacheDir, DefaultConfigurationFactory.createFileNameGenerator(), maxCacheSize);
4646
}
4747

4848
/**
49-
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
50-
* needed for right cache limit work.
49+
* @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for cached files. It's
50+
* needed for right cache limit work.
5151
* @param fileNameGenerator Name generator for cached files
52-
* @param maxCacheSize Maximum cache directory size (in bytes). If cache size exceeds this limit then file with the
53-
* most oldest last usage date will be deleted.
52+
* @param maxCacheSize Maximum cache directory size (in bytes). If cache size exceeds this limit then file with the
53+
* most oldest last usage date will be deleted.
5454
*/
5555
public TotalSizeLimitedDiscCache(File cacheDir, FileNameGenerator fileNameGenerator, int maxCacheSize) {
5656
super(cacheDir, fileNameGenerator, maxCacheSize);

library/src/com/nostra13/universalimageloader/cache/disc/impl/UnlimitedDiscCache.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
*******************************************************************************/
1616
package com.nostra13.universalimageloader.cache.disc.impl;
1717

18-
import java.io.File;
19-
2018
import com.nostra13.universalimageloader.cache.disc.BaseDiscCache;
2119
import com.nostra13.universalimageloader.cache.disc.DiscCacheAware;
2220
import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator;
2321
import com.nostra13.universalimageloader.core.DefaultConfigurationFactory;
2422

23+
import java.io.File;
24+
2525
/**
2626
* Default implementation of {@linkplain DiscCacheAware disc cache}. Cache size is unlimited.
27-
*
27+
*
2828
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
29-
* @since 1.0.0
3029
* @see BaseDiscCache
30+
* @since 1.0.0
3131
*/
3232
public class UnlimitedDiscCache extends BaseDiscCache {
3333

@@ -37,7 +37,7 @@ public UnlimitedDiscCache(File cacheDir) {
3737
}
3838

3939
/**
40-
* @param cacheDir Directory for file caching
40+
* @param cacheDir Directory for file caching
4141
* @param fileNameGenerator Name generator for cached files
4242
*/
4343
public UnlimitedDiscCache(File cacheDir, FileNameGenerator fileNameGenerator) {

library/src/com/nostra13/universalimageloader/cache/disc/naming/FileNameGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/**
1919
* Generates names for files at disc cache
20-
*
20+
*
2121
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
2222
* @since 1.3.1
2323
*/

library/src/com/nostra13/universalimageloader/cache/disc/naming/HashCodeFileNameGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/**
1919
* Names image file as image URI {@linkplain String#hashCode() hashcode}
20-
*
20+
*
2121
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
2222
* @since 1.3.1
2323
*/

library/src/com/nostra13/universalimageloader/cache/disc/naming/Md5FileNameGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
*******************************************************************************/
1616
package com.nostra13.universalimageloader.cache.disc.naming;
1717

18+
import com.nostra13.universalimageloader.utils.L;
19+
1820
import java.math.BigInteger;
1921
import java.security.MessageDigest;
2022
import java.security.NoSuchAlgorithmException;
2123

22-
import com.nostra13.universalimageloader.utils.L;
23-
2424
/**
2525
* Names image file as MD5 hash of image URI
26-
*
26+
*
2727
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
2828
* @since 1.4.0
2929
*/

library/src/com/nostra13/universalimageloader/cache/memory/BaseMemoryCache.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@
1616
package com.nostra13.universalimageloader.cache.memory;
1717

1818
import java.lang.ref.Reference;
19-
import java.util.Collection;
20-
import java.util.Collections;
21-
import java.util.HashMap;
22-
import java.util.HashSet;
23-
import java.util.Map;
19+
import java.util.*;
2420

2521
/**
2622
* Base memory cache. Implements common functionality for memory cache. Provides object references (
2723
* {@linkplain Reference not strong}) storing.
28-
*
24+
*
2925
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
3026
* @since 1.0.0
3127
*/

library/src/com/nostra13/universalimageloader/cache/memory/LimitedMemoryCache.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515
*******************************************************************************/
1616
package com.nostra13.universalimageloader.cache.memory;
1717

18+
import com.nostra13.universalimageloader.utils.L;
19+
1820
import java.util.Collections;
1921
import java.util.LinkedList;
2022
import java.util.List;
2123
import java.util.concurrent.atomic.AtomicInteger;
2224

23-
import com.nostra13.universalimageloader.utils.L;
24-
2525
/**
2626
* Limited cache. Provides object storing. Size of all stored bitmaps will not to exceed size limit (
2727
* {@link #getSizeLimit()}).<br />
2828
* <br />
2929
* <b>NOTE:</b> This cache uses strong and weak references for stored Bitmaps. Strong references - for limited count of
3030
* Bitmaps (depends on cache size), weak references - for all other cached Bitmaps.
31-
*
31+
*
3232
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
33-
* @since 1.0.0
3433
* @see BaseMemoryCache
34+
* @since 1.0.0
3535
*/
3636
public abstract class LimitedMemoryCache<K, V> extends BaseMemoryCache<K, V> {
3737

@@ -49,9 +49,7 @@ public abstract class LimitedMemoryCache<K, V> extends BaseMemoryCache<K, V> {
4949
*/
5050
private final List<V> hardCache = Collections.synchronizedList(new LinkedList<V>());
5151

52-
/**
53-
* @param sizeLimit Maximum size for cache (in bytes)
54-
*/
52+
/** @param sizeLimit Maximum size for cache (in bytes) */
5553
public LimitedMemoryCache(int sizeLimit) {
5654
this.sizeLimit = sizeLimit;
5755
cacheSize = new AtomicInteger();

library/src/com/nostra13/universalimageloader/cache/memory/MemoryCacheAware.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919

2020
/**
2121
* Interface for memory cache
22-
*
22+
*
2323
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
2424
* @since 1.0.0
2525
*/
2626
public interface MemoryCacheAware<K, V> {
2727
/**
2828
* Puts value into cache by key
29-
*
29+
*
3030
* @return <b>true</b> - if value was put into cache successfully, <b>false</b> - if value was <b>not</b> put into
3131
* cache
3232
*/

0 commit comments

Comments
 (0)