Android CharSequence Convert convertValueToList(CharSequence value, String[] options, int defaultValue)

Here you can find the source of convertValueToList(CharSequence value, String[] options, int defaultValue)

Description

convert Value To List

Declaration

public static final int convertValueToList(CharSequence value,
            String[] options, int defaultValue) 

Method Source Code

//package com.java2s;

public class Main {
    public static final int convertValueToList(CharSequence value,
            String[] options, int defaultValue) {
        if (null != value) {
            for (int i = 0; i < options.length; i++) {
                if (value.equals(options[i])) {
                    return i;
                }/*www. j  a  v  a2s.c o  m*/
            }
        }

        return defaultValue;
    }
}

Related

  1. convertValueToBoolean(CharSequence value, boolean defaultValue)
  2. convertValueToInt(CharSequence charSeq, int defaultValue)
  3. convertValueToInt(CharSequence charSeq, int defaultValue)
  4. convertValueToInt(CharSequence charSeq, int defaultValue)
  5. convertValueToList(CharSequence value, String[] options, int defaultValue)
  6. convertValueToList(CharSequence value, String[] options, int defaultValue)
  7. convertValueToUnsignedInt(String value, int defaultValue)
  8. convertValueToUnsignedInt(String value, int defaultValue)
  9. convertValueToUnsignedInt(String value, int defaultValue)