2019-06-06 22:53:25 +00:00
|
|
|
# This file keeps track of the different Java classes used. Whenever refactoring
|
|
|
|
# happens in the Java code, this file should be updated and (hopefully) nothing
|
|
|
|
# will break.
|
2019-05-31 22:13:24 +00:00
|
|
|
|
|
|
|
# General Java objects
|
|
|
|
.class_Object <- "java/lang/Object"
|
|
|
|
.class_String <- "java/lang/String"
|
|
|
|
.class_List <- "java/util/List"
|
|
|
|
.class_ArrayList <- "java/util/ArrayList"
|
|
|
|
.class_Collection <- "java/util/Collection"
|
|
|
|
.class_Serializable <- "java/io/Serializable"
|
|
|
|
.class_File <- "java/io/File"
|
|
|
|
|
|
|
|
# Utility Classes
|
|
|
|
.class_DataUtils <- "ca/joeltherrien/randomforest/utils/DataUtils"
|
|
|
|
.class_RUtils <- "ca/joeltherrien/randomforest/utils/RUtils"
|
2019-07-23 18:17:21 +00:00
|
|
|
.class_Utils <- "ca/joeltherrien/randomforest/utils/Utils"
|
2019-05-31 22:13:24 +00:00
|
|
|
.class_CompetingRiskUtils <- "ca/joeltherrien/randomforest/responses/competingrisk/CompetingRiskUtils"
|
|
|
|
.class_Settings <- "ca/joeltherrien/randomforest/Settings"
|
|
|
|
|
|
|
|
# Misc. Classes
|
|
|
|
.class_RightContinuousStepFunction <- "ca/joeltherrien/randomforest/utils/RightContinuousStepFunction"
|
2019-07-23 18:17:21 +00:00
|
|
|
.class_CompetingRiskResponse <- "ca/joeltherrien/randomforest/responses/competingrisk/CompetingRiskResponse"
|
|
|
|
.class_CompetingRiskResponseWithCensorTime <- "ca/joeltherrien/randomforest/responses/competingrisk/CompetingRiskResponseWithCensorTime"
|
2019-05-31 22:13:24 +00:00
|
|
|
|
|
|
|
# TreeTrainer & its Builder
|
|
|
|
.class_TreeTrainer <- "ca/joeltherrien/randomforest/tree/TreeTrainer"
|
|
|
|
.class_TreeTrainer_Builder <- "ca/joeltherrien/randomforest/tree/TreeTrainer$TreeTrainerBuilder"
|
|
|
|
|
|
|
|
# ForestTrainer & its Builder
|
|
|
|
.class_ForestTrainer <- "ca/joeltherrien/randomforest/tree/ForestTrainer"
|
|
|
|
.class_ForestTrainer_Builder <- "ca/joeltherrien/randomforest/tree/ForestTrainer$ForestTrainerBuilder"
|
|
|
|
|
|
|
|
|
|
|
|
# Covariate classes
|
|
|
|
.class_Covariate <- "ca/joeltherrien/randomforest/covariates/Covariate"
|
|
|
|
.class_BooleanCovariate <- "ca/joeltherrien/randomforest/covariates/bool/BooleanCovariate"
|
|
|
|
.class_FactorCovariate <- "ca/joeltherrien/randomforest/covariates/factor/FactorCovariate"
|
|
|
|
.class_NumericCovariate <- "ca/joeltherrien/randomforest/covariates/numeric/NumericCovariate"
|
|
|
|
|
|
|
|
# Forest class
|
|
|
|
.class_Forest <- "ca/joeltherrien/randomforest/tree/Forest"
|
|
|
|
|
|
|
|
# ResponseCombiner classes
|
|
|
|
.class_ResponseCombiner <- "ca/joeltherrien/randomforest/tree/ResponseCombiner"
|
|
|
|
.class_CompetingRiskResponseCombiner <- "ca/joeltherrien/randomforest/responses/competingrisk/combiner/CompetingRiskResponseCombiner"
|
|
|
|
.class_CompetingRiskFunctionCombiner <- "ca/joeltherrien/randomforest/responses/competingrisk/combiner/CompetingRiskFunctionCombiner"
|
|
|
|
.class_MeanResponseCombiner <- "ca/joeltherrien/randomforest/responses/regression/MeanResponseCombiner"
|
|
|
|
|
|
|
|
# SplitFinder classes
|
|
|
|
.class_SplitFinder <- "ca/joeltherrien/randomforest/tree/SplitFinder"
|
|
|
|
.class_GrayLogRankSplitFinder <- "ca/joeltherrien/randomforest/responses/competingrisk/splitfinder/GrayLogRankSplitFinder"
|
|
|
|
.class_LogRankSplitFinder <- "ca/joeltherrien/randomforest/responses/competingrisk/splitfinder/LogRankSplitFinder"
|
|
|
|
.class_WeightedVarianceSplitFinder <- "ca/joeltherrien/randomforest/responses/regression/WeightedVarianceSplitFinder"
|
|
|
|
|
2019-07-23 18:17:21 +00:00
|
|
|
.object_Optional <- function(object=NULL){
|
|
|
|
if(is.null(object)){
|
2019-06-19 20:14:11 +00:00
|
|
|
return(.jcall("java/util/Optional", "Ljava/util/Optional;", "empty"))
|
|
|
|
} else{
|
2019-07-23 18:17:21 +00:00
|
|
|
object <- .jcast(object, .class_Object)
|
|
|
|
return(.jcall("java/util/Optional", "Ljava/util/Optional;", "of", object))
|
2019-06-19 20:14:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-05-31 22:13:24 +00:00
|
|
|
# When a class object is returned, rJava often often wants L prepended and ; appended.
|
|
|
|
# So a list that returns "java/lang/Object" should show "Ljava/lang/Object;"
|
2019-06-06 22:53:25 +00:00
|
|
|
# This function does that.
|
2019-05-31 22:13:24 +00:00
|
|
|
makeResponse <- function(className){
|
|
|
|
return(paste0("L", className, ";"))
|
|
|
|
}
|