我正在查看 Drools Planner 示例源代码,然后遇到了这样的代码:
@Override
protected Solver createSolver() {
XmlSolverConfigurer configurer = new XmlSolverConfigurer();
configurer.configure(SOLVER_CONFIG);
return configurer.buildSolver();
}
protected Solver createSolverByApi() {
// Not recommended! It is highly recommended to use XmlSolverConfigurer with an XML configuration instead.
SolverConfig solverConfig = new SolverConfig();
solverConfig.setSolutionClass(NQueens.class);
.....TRUNCATED....
solverPhaseConfigList.add(localSearchSolverPhaseConfig);
solverConfig.setSolverPhaseConfigList(solverPhaseConfigList);
return solverConfig.buildSolver();
}
据我所知,createSolver()
和createSolverByApi()
在被显式调用时应该返回Solver对象。
@Override
在这里的意思是什么?@这个术语的一般含义是什么?
编辑:非常抱歉;我不小心重复了What does @Override mean?