Java BitSet firstIndexOfChar(String sqlString, BitSet keys, int startindex)

Here you can find the source of firstIndexOfChar(String sqlString, BitSet keys, int startindex)

Description

first Index Of Char

License

LGPL

Declaration

public static int firstIndexOfChar(String sqlString, BitSet keys, int startindex) 

Method Source Code

//package com.java2s;
/*//from   ww w .  j  a  va2  s  .c  o  m
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
 */

import java.util.BitSet;

public class Main {
    public static int firstIndexOfChar(String sqlString, BitSet keys, int startindex) {
        for (int i = startindex, size = sqlString.length(); i < size; i++) {
            if (keys.get(sqlString.charAt(i))) {
                return i;
            }
        }
        return -1;

    }

    public static int firstIndexOfChar(String sqlString, String string, int startindex) {
        BitSet keys = new BitSet();
        for (int i = 0, size = string.length(); i < size; i++) {
            keys.set(string.charAt(i));
        }
        return firstIndexOfChar(sqlString, keys, startindex);

    }
}

Related

  1. extractSetBitsMsgFromTxSet(final BitSet txSet)
  2. filter(double[] data, BitSet mask)
  3. filterByIndices(List list, BitSet filter)
  4. filtered(final Iterator iterator, final BitSet filter)
  5. findTrue(BitSet set)
  6. firstInvalidOctet(CharSequence cs, BitSet bits)
  7. formatBitset(BitSet bitset, int width)
  8. generateBitSetBySize(int size, boolean initValue)
  9. getBiggerRang(BitSet bitSet)