Package elki.utilities
Class ELKIServiceScanner
- java.lang.Object
-
- elki.utilities.ELKIServiceScanner
-
public class ELKIServiceScanner extends java.lang.Object
A collection of inspection-related utility functions.- Since:
- 0.2
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ELKIServiceScanner.DirClassIterator
Class to iterate over a directory tree.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.ClassLoader
CLASSLOADER
Class loaderstatic java.lang.String
FACTORY_POSTFIX
Factory class postfix.private static Logging
LOG
Class loggerprivate static java.util.List<java.lang.Class<?>>
MASTER_CACHE
(Non-weak) cache for all "frequently scanned" classes.static java.util.Comparator<java.lang.Class<?>>
SORT_BY_NAME
Sort classes by their class name.static java.util.Comparator<java.lang.Class<?>>
SORT_BY_PRIORITY
Comparator to sort classes by priority, then alphabetic.
-
Constructor Summary
Constructors Modifier Constructor Description private
ELKIServiceScanner()
Static methods only.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static int
classPriority(java.lang.Class<?> o1)
Get the priority of a class, or its outer class.private static int
comparePackageClass(java.lang.Class<?> o1, java.lang.Class<?> o2)
Compare two classes, by package name first.private static java.util.List<java.lang.Class<?>>
getMasterCache()
Get or initialize the master cache, synchronizing only on initialization.private static java.util.List<java.lang.Class<?>>
initialize()
Perform a full (slow) scan for classes.static void
load(java.lang.Class<?> restrictionClass)
Load classes via linear scanning.static java.util.Iterator<java.lang.Class<?>>
nonindexedClasses()
Get a list with all classes in the working folder (not including jars!)
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger
-
CLASSLOADER
private static final java.lang.ClassLoader CLASSLOADER
Class loader
-
FACTORY_POSTFIX
public static final java.lang.String FACTORY_POSTFIX
Factory class postfix.- See Also:
- Constant Field Values
-
MASTER_CACHE
private static java.util.List<java.lang.Class<?>> MASTER_CACHE
(Non-weak) cache for all "frequently scanned" classes.
-
SORT_BY_NAME
public static final java.util.Comparator<java.lang.Class<?>> SORT_BY_NAME
Sort classes by their class name. Package first, then class.
-
SORT_BY_PRIORITY
public static final java.util.Comparator<java.lang.Class<?>> SORT_BY_PRIORITY
Comparator to sort classes by priority, then alphabetic.
-
-
Method Detail
-
load
public static void load(java.lang.Class<?> restrictionClass)
Load classes via linear scanning.- Parameters:
restrictionClass
- Class to find subclasses for.
-
nonindexedClasses
public static java.util.Iterator<java.lang.Class<?>> nonindexedClasses()
Get a list with all classes in the working folder (not including jars!)- Returns:
- Classes.
-
getMasterCache
private static java.util.List<java.lang.Class<?>> getMasterCache()
Get or initialize the master cache, synchronizing only on initialization.- Returns:
- Master cache
-
initialize
private static java.util.List<java.lang.Class<?>> initialize()
Perform a full (slow) scan for classes.- Returns:
- Master cache
-
comparePackageClass
private static int comparePackageClass(java.lang.Class<?> o1, java.lang.Class<?> o2)
Compare two classes, by package name first.- Parameters:
o1
- First classo2
- Second class- Returns:
- Comparison result
-
classPriority
private static int classPriority(java.lang.Class<?> o1)
Get the priority of a class, or its outer class.- Parameters:
o1
- Class- Returns:
- Priority
-
-