EzDevInfo.com

gs-collections

A supplement or replacement for the Java Collections Framework.

Distinct objects from property GS collections Java

Assume that I have a list (GS Collections) of Customers with two properties: id and age, I want apply a distinct filter to the property id

 FastList<Customer> customers ...
 customers.distinct( ) //Hey here there's no overload to provide a custom comparator!

Source: (StackOverflow)

ImmutableList does not extend List?

When I dig into the gs-collection source for ImmutableList, it does not extends java.util.List. However the class javadoc mentioned that All ImmutableList implementations must implement the java.util.List.

Why must ask the implementation to implement java.util.List and not the ImmutableList itself to extend java.util.List?


Source: (StackOverflow)

Advertisements

looking for Sorted Heap & Concurrent Queue in gs-collections library

Three questions:

  1. I was told the gs-collections library contains queue implementations but I can't find them in http://www.goldmansachs.com/gs-collections/javadoc/5.1.0/. do they exist? if so, which classes should I look at?

  2. Likewise for a sorted heap class

  3. (Not so much of a question) Does anyone have any experience with the gs-collections library? It's totally new to me, so if you have any experience and advice regarding which tasks it's particular good at please share

Thanks in advance


Source: (StackOverflow)

javadoc Illegal package name

I am trying to build this project https://github.com/goldmansachs/gs-collections . Built with: ant -buildfile build.xml

However I get the following error:

[javadoc] javadoc: error - Illegal package name: "/home/bionix/Desktop/gs-collections/collections-api/target/generated-sources/java/com/gs/collections/api/block/function/primitive/CharFunction.java.crc"
[javadoc] javadoc: error - Illegal package name: "/home/bionix/Desktop/gs-collections/collections-api/target/generated-sources/java/com/gs/collections/api/block/function/primitive/CharFunction0.java.crc

and then here is the result: [javadoc] 100 errors

javadoc-jar:

BUILD FAILED
/home/bionix/Desktop/gs-collections/build.xml:33: The following error occurred while executing this line:
/home/bionix/Desktop/gs-collections/common-build.xml:280: /home/elmaakoul/Desktop/gs-collections/collections-api/target/javadoc does not exist.

I don't know the source of the problem in here. Can someone help me. Thank you

This is the common-build.xml:

    <target name="javadoc" depends="-deploy-properties, -ivy-init">
    <ivy:cachepath pathid="runtime.classpath" conf="runtime" />

    <javadoc
        destdir="target/javadoc"
        author="true"
        version="true"
        use="true"
        useexternalfile="true"
        windowtitle="${javadoc.title} - ${build.version.full}">

        <sourcefiles>
            <resources refid="all-sources" />
        </sourcefiles>

        <classpath refid="runtime.classpath" />

        <doctitle>${javadoc.title} - ${build.version.full}</doctitle>
        <link rel='nofollow' href="http://java.sun.com/j2se/1.5.0/docs/api/" />
    </javadoc>
</target>

<target name="javadoc-jar"
    depends="-deploy-properties, javadoc"
    description="Builds the javadoc jar for the application">
    <jar
        jarfile="${javadoc.jar.name}"
        compress="true"
        index="false"
        basedir="target/javadoc" />
</target>

Source: (StackOverflow)

Why does GSC MutableListMultimap.get(K key) method return a "view" instead of a mutable collection?

While doing a get() on a MutableListMultimap, the list being returned is made unmodifiable (referring to code in AbstractMutableMultimap#get() ).

What is the thought process behind this ? If the collection being used as value in Multimap is of type MutableList wouldn't it make more sense to keep it that way ?

If not, what is the right way to modify that collection ?


Source: (StackOverflow)