Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static final String[] SUPPORTED_FUNCS = new String[] { "SUM", "MIN", "MAX", "COUNT" };

    /**
     * Checks if the function is supported
     * @param func function in String format
     * @return
     */
    public static boolean isValidAgrFunction(String func) {
        String upperFunc = func.toUpperCase();
        for (String agrFunc : SUPPORTED_FUNCS) {
            if (upperFunc.equals(agrFunc))
                return true;
        }
        return false;
    }
}