/*
(non-Javadoc)

@see javax.naming.Name#getPrefix(int)
544075
public Name getPrefix(int index) {
		LinkedList newNames = new LinkedList();
		for (int i = 0; i < index; i++) {
			newNames.add(names.get(i));
		}

		return new DistinguishedName(newNames);
	}
905084
public static String getPrefix(String s) {
        int dot = s.lastIndexOf(".");
        if (dot == -1) {
            return s;
        } else {
            return s.substring(0, dot);
        }
    }
474519
public static String getLevelPrefix(final Level level) {
        // Get the pre link string
        switch (level.getLevelType()) {
            case APPENDIX:
                return "appe-";
            case SECTION:
                return "sect-";
            case PROCESS:
                return "proc-";
            case CHAPTER:
                return "chap-";
            case PART:
                return "part-";
            case PREFACE:
                return "pref-";
            default:
                return "";
        }
    }
778514
private String getPrefixNameBySize() {
        StringBuilder buffer = new StringBuilder();
        buffer.append("_").append(width).append("x").append(height);
        return new String(buffer);
    }
971694
private String noprefix(String name, String... prefix) {
        for (int i = 0; i < prefix.length; i++) {
            if (name.startsWith(prefix[i])) {
                name = name.replaceAll(prefix[i], "");
            }
        }
        return name;
    }
1216944
public static String getPrefix(String input, char delimiter) {
        int index = input.indexOf(delimiter);
        if (index > -1) {
            return input.substring(0, index);
        }

        return input;
    }
839114
static Matcher getPrefix(Matcher matcher) {
    if (matcher instanceof SeqMatcher) {
      List<Matcher> ms = matcher.<SeqMatcher>as().matchers();
      return ms.get(0);
    } else if (matcher instanceof ZeroOrMoreMatcher) {
      ZeroOrMoreMatcher zm = matcher.as();
      return new ZeroOrMoreMatcher(zm.repeated(), TrueMatcher.INSTANCE);
    } else if (matcher instanceof CharSeqMatcher) {
      String pattern = matcher.<CharSeqMatcher>as().pattern();
      return pattern.isEmpty() ? null : new CharSeqMatcher(pattern.charAt(0));
    } else {
      return matcher;
    }
  }
1196847
@Override
	public String getName()
	{
		StringBuilder result = new StringBuilder();
		String prefix = "";

		for (IPOContext ctxt : this)
		{
			String name = ctxt.getName();

			if (name.length() > 0)
			{
				result.append(prefix);
				result.append(name);
				prefix = ", ";
			}
		}

		return result.toString();
	}
853070
public Attribute getAttributeWithPrefix(CharSequence prefix, CharSequence name) {
		for (Attribute attr : event.attributes)
			if (attr.localName.equals(name) && attr.namespacePrefix.equals(prefix))
				return attr;
		return null;
	}
74442
public static String getSuffix(String name, String delimiter)
    {
        return name.substring(name.lastIndexOf(delimiter) + 1);
    }
729355
function getPrefix() {
    var validPrefix = 'abcdef';
    return validPrefix.charAt(Math.floor(Math.random() * validPrefix.length));
  }
198534
public static String getInputValueName(
            @Nullable final String inputPrefix,
            @Nonnull final BiMap<String, String> inputMapper,
            @Nonnull final String field) {
        String name = inputMapper == null ? null : inputMapper.inverse().get(field);
        if (name == null) {
            if (inputMapper != null && inputMapper.containsKey(field)) {
                throw new RuntimeException("field in keys");
            }
            final String[] defaultValues = {
                    Values.TASK_DIRECTORY_KEY, Values.CLIENT_HTTP_REQUEST_FACTORY_KEY,
                    Values.TEMPLATE_KEY, Values.PDF_CONFIG_KEY, Values.SUBREPORT_DIR_KEY,
                    Values.OUTPUT_FORMAT_KEY, Values.JOB_ID_KEY
            };
            if (inputPrefix == null || Arrays.asList(defaultValues).contains(field)) {
                name = field;
            } else {
                name = inputPrefix.trim() +
                        Character.toUpperCase(field.charAt(0)) +
                        field.substring(1);
            }
        }
        return name;
    }
597671
private NameGenerator getNameGenerator(String namePrefix)
    {
        synchronized(this)
        {
            if (_nameGenerators == null)
                _nameGenerators = new HashMap<String,NameGenerator>();

            NameGenerator nameGenerator = _nameGenerators.get(namePrefix);
            if (nameGenerator == null)
            {
                nameGenerator = new NameGenerator(namePrefix);
                _nameGenerators.put(namePrefix, nameGenerator);
            }
            return nameGenerator;
        }
    }
439237
@Override
	public String getPrefixPart(final String key) {
		if (key != null) {
			lock.readLock().lock();
			try {
				for (final String prefixString : prefixes) {
					if (key.startsWith(prefixString + getPrefixDelimiter())) {
						return prefixString + getPrefixDelimiter();
					}
				}
			} finally {
				lock.readLock().unlock();
			}
			return "";
		}
		throw new IllegalArgumentException("The given key is null.");
	}
1002914
public static long getPrefix(byte[] bytes) {
    if (bytes == null) {
      return 0L;
    } else {
      final int minLen = Math.min(bytes.length, 8);
      long p = 0;
      for (int i = 0; i < minLen; ++i) {
        p |= ((long) Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i) & 0xff)
            << (56 - 8 * i);
      }
      return p;
    }
  }
1071122
protected static final String getPrefixPart(String qname)
    {
        final int col = qname.indexOf(':');
        return (col > 0) ? qname.substring(0, col) : null;
        //return (col > 0) ? qname.substring(0,col) : "";
    }
1092865
public String getPrefix(PackageElement packageElement) {
    if (packageElement == null) {
      return "";
    }
    String packageName = packageElement.getQualifiedName().toString();
    String prefix = getPrefix(packageName);
    if (prefix != null) {
      return prefix;
    }

    prefix = packageLookup.getObjectiveCName(packageName);
    if (prefix == null) {
      prefix = NameTable.camelCaseQualifiedName(packageName);
    }
    addPrefix(packageName, prefix);
    return prefix;
  }