@ -36,6 +36,7 @@ import java.util.Comparator;
import java.util.Enumeration ;
import java.util.List ;
import java.util.Set ;
import java.util.stream.Collectors ;
import java.util.zip.ZipEntry ;
import java.util.zip.ZipFile ;
@ -46,6 +47,7 @@ public final class FunctionConstants {
public static NameAndFunctionList COMMON = getCommonFunctionList ( ) ;
public static NameAndTypeAndFunctionList [ ] EMBFUNCTIONS = getEmbededFunctionListArray ( ) ;
public static FunctionGroup ALL = getAllFunctionGroup ( ) ;
public static List < String > abandonFormulas = Arrays . asList ( "CIRCULAR" , "CROSSLAYERTOTAL" , "HIERARCHY" , "LAYERTOTAL" ) ;
static {
loadEmbededFunctions ( ) ;
@ -54,7 +56,8 @@ public final class FunctionConstants {
/ * *
* Don ' t let anyone instantiate this class .
* /
private FunctionConstants ( ) { }
private FunctionConstants ( ) {
}
private static void loadEmbededFunctions ( ) {
String pkgName = "com.fr.function" ;
@ -89,6 +92,9 @@ public final class FunctionConstants {
if ( StableUtils . classInstanceOf ( cls , iface ) ) {
Function inst ;
inst = ( Function ) cls . newInstance ( ) ;
if ( abandonFormulas . contains ( inst . getClass ( ) . getSimpleName ( ) ) ) {
continue ;
}
for ( NameAndTypeAndFunctionList EMBFUNCTION : EMBFUNCTIONS ) {
if ( EMBFUNCTION . test ( inst ) ) {
break ;
@ -305,6 +311,7 @@ public final class FunctionConstants {
Collections . addAll ( all , createFunctionGroup ( ( ( FunctionDefContainer ) container ) ) . getDescriptions ( ) ) ;
}
}
all = all . stream ( ) . filter ( n - > ! abandonFormulas . contains ( n . getName ( ) ) ) . collect ( Collectors . toList ( ) ) ;
Collections . sort ( all , new Comparator < NameAndDescription > ( ) {
@Override