简体   繁体   中英

Min Max Priority Queue for Scala

I am searching a library with a MaxMinPriorityQueue like guava's one . As I can't use it because sbt fails when I add the dependency like this:

"com.google.guava" %% "guava" % "24.0-jre"

Its seems there is no build for scala, as it can be found:

com.google.guava:guava_2.11:24.0-jre: not found.

After searching for a while I found no similar Data Structure for Scala. Does someone knows of any implementation for a MinMaxPriorityQueue for scala?

Thanks.

This works

"com.google.guava" % "guava" % "24.0-jre"

Its written in java. so it doesn't need a scala version. thus you don't need to specify '%%' in the dependency.

The double percent sign %% adds the "_2.11" suffix to the "guava" identifier. Since "guava" is just a Java library, it doesn't know anything about Scala at all, and it certainly does not have any versions packaged specifically for Scala 2.11.

Just copy the library dependency directly from Maven Central, as it is:

libraryDependencies += "com.google.guava" % "guava" % "24.0-jre"

(note the single % ), it should work then.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM