All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.deephaven.engine.table.impl.util.reverse.CharReverseKernel Maven / Gradle / Ivy

There is a newer version: 0.36.1
Show newest version
/**
 * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
 */
package io.deephaven.engine.table.impl.util.reverse;

import io.deephaven.chunk.*;
import io.deephaven.chunk.attributes.Any;

public class CharReverseKernel {
    public static  void reverse(WritableCharChunk chunkToReverse) {
        for (int ii = 0; ii < chunkToReverse.size() / 2; ++ii) {
            final int jj = chunkToReverse.size() - ii - 1;
            final char t = chunkToReverse.get(jj);
            chunkToReverse.set(jj, chunkToReverse.get(ii));
            chunkToReverse.set(ii, t);
        }
    }

    private static class CharReverseKernelContext implements ReverseKernel {
        @Override
        public  void reverse(WritableChunk chunkToReverse) {
            CharReverseKernel.reverse(chunkToReverse.asWritableCharChunk());
        }
    }

    public final static ReverseKernel INSTANCE = new CharReverseKernelContext();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy