Java List First Item getFirstNameIndex(List list)

Here you can find the source of getFirstNameIndex(List list)

Description

get First Name Index

License

Open Source License

Declaration

private static int getFirstNameIndex(List<String> list) 

Method Source Code

//package com.java2s;

import java.util.List;
import java.util.Set;

public class Main {
    static Set<String> personStopWordSet;

    private static int getFirstNameIndex(List<String> list) {
        for (int i = 0; i < list.size(); i++) {
            if ((list.get(i).length() > 1) && (!personStopWordSet.contains(list.get(i)))) {
                return i;
            }/*from w  w  w .j  av  a  2 s . c om*/
        }
        return -1;
    }
}

Related

  1. getFirstElementFromList(List list)
  2. getFirstFromList(List list)
  3. getFirstInstanceOf(List source, String className)
  4. getFirstItemOrNull(List items)
  5. getFirstLeaf(List aList)
  6. getFirstNonEmptyIndex(final List> list)
  7. getFirstObject(List valueList)
  8. getFirstOccurNic(List nics, String line)
  9. getFirstOrNull(List elements)

  10. HOME | Copyright © www.java2s.com 2016