Package: primitives

## [Java] Class long[][]

- primitives.long[][]

-     public class long[][]
      extends Object

  GDK enhancements for long[][].

  displayName:
    long[][]
  receiverFqcn:
    long[][]

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public long[]` | `column(int col)` Select a column from a 2D array.
    `` | `public long` | `eachColumn(Closure<?> closure)` Process the columns of the array.
    `` | `public List<Long>` | `flatten()` Flattens a 2D array into a new collection.
    `` | `public long` | `transpose()` A transpose method for 2D long arrays.
    `` | `public Iterator<long[]>` | `transposing()` An iterator of the columns of the array.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, clamp, clamp, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, takeIf, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### public long[] column(int col)

      Select a column from a 2D array.

           long[][] nums = [[1L, 2L], [10L, 20L]]
           assert nums.column(0) == [1L, 10L] as long[]
           assert nums.column(1) == [2L, 20L] as long[]

      Returns:
        a long[]
      Since:
        5.0.0

    - #### public long eachColumn(Closure<?> closure)

      Process the columns of the array.

           double[][] nums = [[1L, 2L], [10L, 20L]]
           nums.eachColumn {
               assert it[0] * 10L == it[1]
           }

      Parameters:
        `closure` - the closure applied on each array column
      Returns:
        the self array
      Since:
        5.0.0

    - #### public List<Long> flatten()

      Flattens a 2D array into a new collection. The items are copied row by row.

      Example usage:

           long[][] array = [[0, 1], [2, 3]]
           assert array.flatten() == [0, 1, 2, 3]

      Returns:
        a Collection of the array elements
      Since:
        5.0.0

    - #### public long transpose()

      A transpose method for 2D long arrays.

      Example usage:

           long[][] longs = [[1L, 3L, 5L], [2L, 4L, 6L]]
           long[][] expected = [[1L, 2L], [3L, 4L], [5L, 6L]]
           def result = longs.transpose()
           assert result == expected
           assert longs.class.componentType == result.class.componentType

      Returns:
        the transposed 2D long array
      Since:
        3.0.8

    - #### public Iterator<long[]> transposing()

      An iterator of the columns of the array.

           long[][] nums = [[1L, 2L], [10L, 20L]]
           assert nums.transpose() == nums.transposing().toList()
           assert nums.transposing().collect{ long[] col -> col.sum() } == [11L, 22L]

      Returns:
        the iterator
      Since:
        5.0.0