我正在查看 Hive 开源代码并遇到了一个奇怪的构造函数调用:
public ResultSet getUDTs(String catalog, String schemaPattern,
String typeNamePattern, int[] types) throws SQLException {
return new HiveMetaDataResultSet(
Arrays.asList("TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME", "CLASS_NAME", "DATA_TYPE"
, "REMARKS", "BASE_TYPE")
, Arrays.asList("STRING", "STRING", "STRING", "STRING", "INT", "STRING", "INT")
, null) {
public boolean next() throws SQLException {
return false;
}
};
}
HiveMetaDataResultSet 的构造函数定义是接受三个 List 作为参数。
我的问题是:
public boolean next() throws SQLException {
return false;
}
在这种情况下部分做什么?它不是作为参数的匿名调用,因为这 3 个参数是由它们自己完成的,并且这个参数位于构造函数调用的主体中。