Java Vector Contains(Vector V, int[] elt)

Here you can find the source of Contains(Vector V, int[] elt)

Description

Contains

License

Open Source License

Declaration

private static boolean Contains(Vector<int[]> V, int[] elt) 

Method Source Code

//package com.java2s;
/*//  w w  w . j  a va2 s.  co  m
 *File:  Util.java
 *
 * Copyright (C) Ruth Mikkelson 2008
 *
 * This program is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
 *
 * Contact:Ruth Mikkelson,mikkelsonr@uwstout.edu
 *         Menomonie, WI 54751
 *
 * This work was supported by the Intense Pulsed Neutron Source Division
 * of Argonne National Laboratory, Argonne, IL 60439-4845, USA. 
 *
 *  Last Modified:
 * 
 *  $Author: eu7 $
 *  $Date: 2008-04-08 16:31:08 -0500 (Tue, 08 Apr 2008) $            
 *  $Revision: 19031 $
*/

import java.util.*;

public class Main {
    private static boolean Contains(Vector<int[]> V, int[] elt) {
        if (V == null || V.size() < 1)
            return false;
        if (elt == null || elt.length != 2)
            return true;
        for (int i = 0; i < V.size(); i++) {
            int[] R = V.elementAt(i);
            if (R[0] == elt[0] && R[1] == elt[1])
                return true;
        }
        return false;
    }
}

Related

  1. clonevector(Vector vec)
  2. combineWithQuotes(Vector commands, int startAt)
  3. copyVector(Vector V)
  4. deleteLast(Vector list)
  5. enumerationToVector(Enumeration pEnumeration_)
  6. getCommaListFromVector(Vector sourceVector)