Package com.ibm.icu.util

Examples of com.ibm.icu.util.StringTokenizer.countTokens()


        return false;

      //is phrase
      String phrase = mailbox.substring(0, idxLT);
      StringTokenizer st = new StringTokenizer(phrase, " ");
      if (st.countTokens() == 0)
        return false;
      while (st.hasMoreTokens())
      {
        if (!isWord(st.nextToken()))
          return false;
View Full Code Here


    {
      // Get each entry in the post header
      StringTokenizer postMessage = new StringTokenizer(httpHeader, " \r\n");

      // If there is no third token, then fail
      if (postMessage.countTokens() < 3)
      {
        result = AssertionResult.RESULT_FAILED;
        failureDetail = this.validator.createFailureDetail(httpHeader, entryContext);
      }
      else
View Full Code Here

     */
   
    String cleanContentTypeValue = StringUtils.stripNonLetterDigits(contentType);
    /* Break the mime header into the main value and its parameters, separated by ';' */
    StringTokenizer tokenizer = new StringTokenizer(cleanContentTypeValue, ";"); //$NON-NLS-1$
    int tLen = tokenizer.countTokens();
    if (tLen == 0)
      return;
    String[] tokens = new String[tLen];
    int j = 0;
    while (tokenizer.hasMoreTokens()) {
View Full Code Here

    }

    // check attributes
    for (i = selector.getNumOfAttributes() - 1; i >= 0; i--) {
      StringTokenizer tokenizer = new StringTokenizer(selector.getAttribute(i), "=~| \t\r\n\f");//$NON-NLS-1$
      int countTokens = tokenizer.countTokens();
      if (countTokens > 0) {
        String attrName = tokenizer.nextToken();
        String attrValue = null;
        if (!element.hasAttribute(attrName) || (attrValue = element.getAttribute(attrName)).length() == 0)
          return false;
View Full Code Here

   */
  public TextHoverDescriptor[] generateTextHoverDescriptors(String textHoverStrings) {
    StringTokenizer st = new StringTokenizer(textHoverStrings, HOVER_SEPARATOR);

    // read from preference and load id-descriptor mapping to a hash table
    HashMap idToModifier = new HashMap(st.countTokens());
    while (st.hasMoreTokens()) {
      String textHoverString = st.nextToken();
      StringTokenizer st2 = new StringTokenizer(textHoverString, HOVER_ATTRIBUTE_SEPARATOR);
      if (st2.countTokens() == 3) {
        String id = st2.nextToken();
View Full Code Here

    // read from preference and load id-descriptor mapping to a hash table
    HashMap idToModifier = new HashMap(st.countTokens());
    while (st.hasMoreTokens()) {
      String textHoverString = st.nextToken();
      StringTokenizer st2 = new StringTokenizer(textHoverString, HOVER_ATTRIBUTE_SEPARATOR);
      if (st2.countTokens() == 3) {
        String id = st2.nextToken();
        boolean enabled = Boolean.valueOf(st2.nextToken()).booleanValue();
        String modifierString = st2.nextToken();
        if (modifierString.equals(NO_MODIFIER))
          modifierString = ""; //$NON-NLS-1$
View Full Code Here

  private String getMimeTypeFromContentTypeValue(String contentTypeValue) {
    if (contentTypeValue == null)
      return null;
    String cleanContentTypeValue = StringUtils.stripNonLetterDigits(contentTypeValue);
    StringTokenizer tokenizer = new StringTokenizer(cleanContentTypeValue, ";= \t\n\r\f"); //$NON-NLS-1$
    int tLen = tokenizer.countTokens();
    // if contains encoding should have three tokens, the mimetype, the
    // word 'charset', and the encoding value
    String[] tokens = new String[tLen];
    int j = 0;
    while (tokenizer.hasMoreTokens()) {
View Full Code Here

    // ----------------------
    // calculate java ranges
    // ----------------------
    StringTokenizer st = new StringTokenizer(newText, " ", false); //$NON-NLS-1$
    int i = 0;
    String[] parsedJava = new String[st.countTokens()];
    while (st.hasMoreTokens())
      parsedJava[i++] = st.nextToken();

    String type = parsedJava[0] != null ? parsedJava[0] : ""; //$NON-NLS-1$
    String id = parsedJava[1] != null ? parsedJava[1] : ""; //$NON-NLS-1$
View Full Code Here

   * @param typeName
   * @return a Qualified name with the package as the qualifier, and class name as LocalName
   */
  private QualifiedName getTypeQualifiedName(String typeName) {
    StringTokenizer st = new StringTokenizer(typeName, ".", false); //$NON-NLS-1$
    int length = st.countTokens();
    int count = 0;
    StringBuffer root = new StringBuffer();
    while (count++ < length - 1) {
      root.append(st.nextToken());
      if (count < length - 1)
View Full Code Here

  private String getMimeTypeFromContentTypeValue(String contentTypeValue) {
    if (contentTypeValue == null)
      return null;
    String cleanContentTypeValue = StringUtils.stripNonLetterDigits(contentTypeValue);
    StringTokenizer tokenizer = new StringTokenizer(cleanContentTypeValue, ";= \t\n\r\f"); //$NON-NLS-1$
    int tLen = tokenizer.countTokens();
    // if contains encoding should have three tokens, the mimetype, the
    // word 'charset', and the encoding value
    String[] tokens = new String[tLen];
    int j = 0;
    while (tokenizer.hasMoreTokens()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.