Java Long Number Create toLong(int x, int z)

Here you can find the source of toLong(int x, int z)

Description

Shift two int's together to form a compund key

License

BSD License

Parameter

Parameter Description
x value of key
z value of key

Return

long compund of the two int's

Declaration

public static long toLong(int x, int z) 

Method Source Code

//package com.java2s;
/*/*ww w  .ja  v  a  2  s. co  m*/
 * Copyright (c) 2015, GoMint, BlackyPaw and geNAZt
 *
 * This code is licensed under the BSD license found in the
 * LICENSE file in the root directory of this source tree.
 */

public class Main {
    /**
     * Shift two int's together to form a compund key
     *
     * @param x value of key
     * @param z value of key
     * @return long compund of the two int's
     */
    public static long toLong(int x, int z) {
        return ((long) x << 32) + z - Integer.MIN_VALUE;
    }
}

Related

  1. toLong(final String value)
  2. toLong(final String value)
  3. toLong(final String value)
  4. toLong(int numBytes, long value)
  5. toLong(int value)
  6. toLong(int[] a)
  7. toLong(int[] x, int length, int M)
  8. toLong(Integer i)
  9. toLong(long[] array)