Search in sources :

Example 21 with Data

use of com.searchcode.app.dao.Data in project searchcode-server by boyter.

the class CommonRouteService method getMatchLines.

public static double getMatchLines() {
    if (App.ISCOMMUNITY) {
        return Double.parseDouble(Values.DEFAULTMATCHLINES);
    }
    Data data = Singleton.getData();
    String matchLines = data.getDataByName(Values.MATCHLINES);
    if (matchLines == null) {
        data.saveData(Values.MATCHLINES, Values.DEFAULTMATCHLINES);
        matchLines = Values.DEFAULTMATCHLINES;
    }
    return Double.parseDouble(matchLines);
}
Also used : Data(com.searchcode.app.dao.Data)

Example 22 with Data

use of com.searchcode.app.dao.Data in project searchcode-server by boyter.

the class CommonRouteService method getMinifiedLength.

public static double getMinifiedLength() {
    if (App.ISCOMMUNITY) {
        return Double.parseDouble(Values.DEFAULTMINIFIEDLENGTH);
    }
    Data data = Singleton.getData();
    String minifiedLength = data.getDataByName(Values.MINIFIEDLENGTH);
    if (minifiedLength == null) {
        data.saveData(Values.MINIFIEDLENGTH, Values.DEFAULTMINIFIEDLENGTH);
        minifiedLength = Values.DEFAULTMINIFIEDLENGTH;
    }
    return Double.parseDouble(minifiedLength);
}
Also used : Data(com.searchcode.app.dao.Data)

Aggregations

Data (com.searchcode.app.dao.Data)22 Repo (com.searchcode.app.dao.Repo)4 CodeMatcher (com.searchcode.app.service.CodeMatcher)3 RepoResult (com.searchcode.app.model.RepoResult)2 CodeSearcher (com.searchcode.app.service.CodeSearcher)2 ModelAndView (spark.ModelAndView)2 Request (spark.Request)2 Gson (com.google.gson.Gson)1 App (com.searchcode.app.App)1 Values (com.searchcode.app.config.Values)1 Api (com.searchcode.app.dao.Api)1 com.searchcode.app.dto (com.searchcode.app.dto)1 CodeResult (com.searchcode.app.dto.CodeResult)1 SearchResult (com.searchcode.app.dto.SearchResult)1 Singleton (com.searchcode.app.service.Singleton)1 TimeCodeSearcher (com.searchcode.app.service.TimeCodeSearcher)1 CodeRouteService (com.searchcode.app.service.route.CodeRouteService)1 CommonRouteService (com.searchcode.app.service.route.CommonRouteService)1 com.searchcode.app.util (com.searchcode.app.util)1 Properties (com.searchcode.app.util.Properties)1