Examples of decompose()


Examples of org.jboss.netty.buffer.CompositeChannelBuffer.decompose()

            // Make sure the resulting cumulation buffer has no more than the configured components.
            CompositeChannelBuffer composite = (CompositeChannelBuffer) cumulation;
            if (composite.numComponents() >= maxCumulationBufferComponents) {
                currentMessage.setContent(ChannelBuffers.wrappedBuffer(composite.copy(), input));
            } else {
                List<ChannelBuffer> decomposed = composite.decompose(0, composite.readableBytes());
                ChannelBuffer[] buffers = decomposed.toArray(new ChannelBuffer[decomposed.size() + 1]);
                buffers[buffers.length - 1] = input;

                currentMessage.setContent(ChannelBuffers.wrappedBuffer(buffers));
            }
View Full Code Here

Examples of org.libreplan.business.workingday.EffortDuration.decompose()

    }

    @Test
    public void anEffortDurationCanBeDecomposedIntoElements() {
        EffortDuration duration = hours(1).and(90, Granularity.MINUTES);
        EnumMap<Granularity, Integer> values = duration.decompose();
        assertThat(values.get(Granularity.HOURS), equalTo(2));
        assertThat(values.get(Granularity.MINUTES), equalTo(30));
        assertThat(values.get(Granularity.SECONDS), equalTo(0));
    }
View Full Code Here

Examples of org.libreplan.business.workingday.EffortDuration.decompose()

    }

    @Test
    public void anZeroDurationHasZeroElements() {
        EffortDuration duration = EffortDuration.zero();
        EnumMap<Granularity, Integer> values = duration.decompose();
        assertThat(values.get(Granularity.HOURS), equalTo(0));
        assertThat(values.get(Granularity.MINUTES), equalTo(0));
        assertThat(values.get(Granularity.SECONDS), equalTo(0));
    }
View Full Code Here

Examples of ru.ifmo.diplom.kirilchuk.jawelet.core.dwt.transforms.DWTransform1D.decompose()

        DWTransform1D instance = new HaarWaveletTransform();
        double[] approximationExpect = {2.121320343559, 4.949747468305, 7.778174593052, 4.949747468305};
        double[] detailExpect = {-0.707106781186, -0.707106781186, -0.707106781186, 4.949747468306};

        DecompositionResult result = instance.decompose(data, 1);
        assertArrayEquals(approximationExpect, result.getApproximation(), DOBLE_COMPARISON_DELTA);
        assertArrayEquals(detailExpect, result.getDetailsList().get(0), DOBLE_COMPARISON_DELTA);
    }

    @Test
View Full Code Here

Examples of ru.ifmo.diplom.kirilchuk.jawelet.core.dwt.transforms.haar.impl.HaarWaveletTransform.decompose()

        DWTransform1D instance = new HaarWaveletTransform();
        double[] approximationExpect = {2.121320343559, 4.949747468305, 7.778174593052, 4.949747468305};
        double[] detailExpect = {-0.707106781186, -0.707106781186, -0.707106781186, 4.949747468306};

        DecompositionResult result = instance.decompose(data, 1);
        assertArrayEquals(approximationExpect, result.getApproximation(), DOBLE_COMPARISON_DELTA);
        assertArrayEquals(detailExpect, result.getDetailsList().get(0), DOBLE_COMPARISON_DELTA);
    }

    @Test
View Full Code Here

Examples of ru.ifmo.diplom.kirilchuk.jawelet.core.dwt.transforms.legall.impl.LeGallWaveletTransform.decompose()

    @Test
    public void testReconstructionFrom1LevelWithLeGall() {
        double[] data = {1,2,3,4};

        DWTransform1D instance = new LeGallWaveletTransform();
        DecompositionResult result = instance.decompose(data, 1);

        double[] reconstructed = instance.reconstruct(result);
        assertArrayEquals(data, reconstructed, DOBLE_COMPARISON_DELTA);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.