Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我可以将列表作为参数传递给Scala/Java中的方法吗?该方法是以自动检测的方式定义的(DelimiterForDetection:Char*)_Java_Scala - Fatal编程技术网

我可以将列表作为参数传递给Scala/Java中的方法吗?该方法是以自动检测的方式定义的(DelimiterForDetection:Char*)

我可以将列表作为参数传递给Scala/Java中的方法吗?该方法是以自动检测的方式定义的(DelimiterForDetection:Char*),java,scala,Java,Scala,我正在创建一个库来帮助更正CSV,为了做到这一点,我正在使用univocity解析器库。 我正在使用CSVParserSettings类方法detectFormatAutomatically,它是这样定义的 自动检测格式(delimitersForDetection:Char*) 是否有任何方法可以将scala列表或任何列表作为参数传递,以便不必在代码本身中定义此字符。 我应该能够通过Linux终端传递带有字符的字符串,然后将其解析为Scala代码中的字符列表。问题是我得到了字符列表,但我无法将

我正在创建一个库来帮助更正CSV,为了做到这一点,我正在使用univocity解析器库。 我正在使用CSVParserSettings类方法
detectFormatAutomatically
,它是这样定义的
自动检测格式(delimitersForDetection:Char*)
是否有任何方法可以将scala列表或任何列表作为参数传递,以便不必在代码本身中定义此字符。 我应该能够通过Linux终端传递带有字符的字符串,然后将其解析为Scala代码中的字符列表。问题是我得到了字符列表,但我无法将其作为参数传递给该方法。 我的代码:

错误为:类型不匹配,预期为:Char,实际为:List[Char]

有什么方法可以让我得到我想做的事。

使用

settings.detectFormatAutomatically(list:_*)

settings.detectFormatAutomatically(list:*)
应该可以工作。@你应该把它作为一个答案,而不是一个注释。@Tim done。让它成为社区维基的答案。
settings.detectFormatAutomatically(list:_*)