Java List Contain contains(int[] subject, int[][] list)

Here you can find the source of contains(int[] subject, int[][] list)

Description

contains

License

Apache License

Declaration

public static boolean contains(int[] subject, int[][] list) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Arrays;

import java.util.List;

public class Main {
    public static boolean contains(int[] subject, int[][] list) {
        for (int[] row : list) {
            if (Arrays.equals(subject, row)) {
                return true;
            }/*from w  w  w .ja va  2 s .co m*/
        }
        return false;
    }

    public static boolean equals(int[][] ar1, int[][] ar2) {
        if (ar1.length != ar2.length)
            return false;
        for (int[] row1 : ar1) {
            if (!contains(row1, ar2)) {
                return false;
            }
        }
        return true;
    }

    public static <T> boolean equals(List<List<T>> lists1, List<List<T>> lists2) {
        for (List<T> list1 : lists1) {
            if (!lists2.contains(list1)) {
                return false;
            }
        }
        return true;
    }
}

Related

  1. contains(final List list, T value)
  2. contains(final String text, final List tokens)
  3. contains(final String[] list, final String value)
  4. contains(int[] list, int x)
  5. contains(int[] match, List container)
  6. contains(List aList, Object anObj)
  7. contains(List list, Object obj)
  8. contains(List lsttor, Object val)
  9. contains(List list, Object element, int begin, int end)