Returns the first occurrence of a given name, given the matching rules described in {@link
AccessibleByName}, or -1 if it's not in the list.
333445
public int firstIndexOf(String name) {
    Integer index =
        (Strings.isDoubleQuoted(name))
            ? byCaseSensitiveName.get(Strings.unDoubleQuote(name))
            : byCaseInsensitiveName.get(name.toLowerCase());
    return (index == null) ? -1 : index;
  }
508775
static int getIndex(CharSequence name) {
        Integer index = STATIC_INDEX_BY_NAME.get(name);
        if (index == null) {
            return -1;
        }
        return index;
    }
1167881
public T get(String name) {		
		String lcName = name.toLowerCase();
		for (T item : collection) {
			if (item.getName().toLowerCase().equals(lcName)) {
				return item;
			}
		}

		return null;
	}
1298525
public static String extractGivenName(String name)
    {
        if (name.length() <= 2)
            return "_" + name.substring(name.length() - 1);
        else
            return name.substring(name.length() - 2);

    }
780744
static String firstToLower(String name){
        if (name.length() == 1){
            return name.toLowerCase();
        }

        String firstLetter = name.substring(0, 1).toLowerCase();
        return firstLetter + name.substring(1);
    }
771602
function(name) {
    var nameList = name.split('.');

    return nameList
      .map(function(item, i, list) {
        return list.slice(0, i+1).join('.');
      })
      .filter(function(item) {
        return item !== null;
      });
  }
296902
private static String getTopVarName(String name) {
    int firstDotIndex = name.indexOf('.');
    return firstDotIndex == -1 ? name : name.substring(0, firstDotIndex);
  }
753363
def find(self, name):
    
    for i in range(0, len(self)):
      if self[i].name == name:
        return i
    return -1
234719
protected static Assignment findAssignmentFromFeatureName(EObject rule, String name) {
		return IterableExtensions.findFirst(GrammarUtil.containedAssignments(rule),
				assignment -> name.equals(assignment.getFeature()));
	}
1051333
private Name getNameObject(List<? extends Name> list, double probability) {
        int index = Collections.binarySearch(list, new Name(null, probability), locateNameByCumulativeProbability);
        if (index >= 0) {
            return list.get(index);
        } else if (-index > list.size()) {
            throw new RuntimeException("Invalid probability provided - (" + probability +
                    "). Max allowed for this list is " + getMax(list));
        } else {
            return list.get((-index) - 1);
        }
    }
1079762
private int findFirst(CharSequence input, int beginIndex, int rewindIndex) {
        int first = -1;
        int digit = -1;
        for (int i = beginIndex; i >= rewindIndex; i--) {
            char c = input.charAt(i);
            if (Scanners.isAlpha(c)) {
                first = i;
            } else if (Scanners.isDigit(c)) {
                digit = i;
            } else if (!schemeSpecial(c)) {
                break;
            }
        }
        if (first > 0 && first - 1 == digit) {
            // We don't want to extract "abc://foo" out of "1abc://foo".
            // ".abc://foo" and others are ok though, as they feel more like separators.
            first = -1;
        }
        return first;
    }
39484
public String getFirstPriorityTag(List<String> restrictions) {
        for (String str : restrictions) {
            if (hasTag(str))
                return getTag(str);
        }
        return "";
    }
421947
public String first(String localName) {
		for (Element child : children()) {
			if (localName.equals(child.getLocalName()) && XCAL_NS.equals(child.getNamespaceURI())) {
				return child.getTextContent();
			}
		}
		return null;
	}
481636
public User get(String name) {

        User user = (User) userList.get(name);

        if (user == null) {
            throw Error.error(ErrorCode.X_28501, name);
        }

        return user;
    }
1285524
private static Element getFirstNamedElement(Element element, String name) {
		NodeList list = element.getElementsByTagName(name);
		if (list.getLength() == 0) {
			return null;
		}

		return (Element) list.item(0);
	}
555741
public static Predicate<Field> named(final String name) {
        return field -> Pattern.compile(name).matcher(field.getName()).matches();
    }
694438
private String getInitials(String name)
   {
      String result = null;

      if (name != null && name.length() != 0)
      {
         StringBuilder sb = new StringBuilder();
         sb.append(name.charAt(0));
         int index = 1;
         while (true)
         {
            index = name.indexOf(' ', index);
            if (index == -1)
            {
               break;
            }

            ++index;
            if (index < name.length() && name.charAt(index) != ' ')
            {
               sb.append(name.charAt(index));
            }

            ++index;
         }

         result = sb.toString();
      }

      return result;
   }