Package com.gs.collections.api.block.procedure.primitive

Examples of com.gs.collections.api.block.procedure.primitive.DoubleIntProcedure


    }

    public int count(final DoublePredicate predicate)
    {
        final Counter result = new Counter();
        this.forEachWithOccurrences(new DoubleIntProcedure()
        {
            public void value(double each, int occurrences)
            {
                if (predicate.accept(each))
                {
View Full Code Here


    }

    public <V> MutableBag<V> collect(final DoubleToObjectFunction<? extends V> function)
    {
        final HashBag<V> result = HashBag.newBag(this.items.size());
        this.forEachWithOccurrences(new DoubleIntProcedure()
        {
            public void value(double each, int occurrences)
            {
                result.addOccurrences(function.valueOf(each), occurrences);
            }
View Full Code Here

    }

    public double sum()
    {
        final double[] result = {0.0};
        this.forEachWithOccurrences(new DoubleIntProcedure()
        {
            public void value(double each, int occurrences)
            {
                result[0] += (double) each * occurrences;
            }
View Full Code Here

    public double[] toArray()
    {
        final double[] array = new double[this.size()];
        final int[] index = {0};

        this.forEachWithOccurrences(new DoubleIntProcedure()
        {
            public void value(double each, int occurrences)
            {
                for (int i = 0; i < occurrences; i++)
                {
View Full Code Here

    public void writeExternal(final ObjectOutput out) throws IOException
    {
        out.writeInt(this.items.size());
        try
        {
            this.items.forEachKeyValue(new DoubleIntProcedure()
            {
                public void value(double each, int occurrences)
                {
                    try
                    {
View Full Code Here

TOP

Related Classes of com.gs.collections.api.block.procedure.primitive.DoubleIntProcedure

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.