java.lang.String.indexAndLength()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(203)

本文整理了Java中java.lang.String.indexAndLength()方法的一些代码示例,展示了String.indexAndLength()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。String.indexAndLength()方法的具体详情如下:
包路径:java.lang.String
类名称:String
方法名:indexAndLength

String.indexAndLength介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Returns the character at the specified offset in this string.
 *
 * @param index
 *            the zero-based index in this string.
 * @return the character at the index.
 * @throws IndexOutOfBoundsException
 *             if {@code index < 0} or {@code index >= length()}.
 */
public char charAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return value[offset + index];
}

代码示例来源:origin: robovm/robovm

/**
 * Returns the Unicode code point at the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 0 || index >= length()}
 * @see Character#codePointAt(char[], int, int)
 * @since 1.5
 */
public int codePointAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return Character.codePointAt(value, offset + index, offset + count);
}

代码示例来源:origin: robovm/robovm

/**
 * Returns a string containing a suffix of this string. The returned string
 * shares this string's <a href="#backing_array">backing array</a>.
 *
 * @param start
 *            the offset of the first character.
 * @return a new string containing the characters from start to the end of
 *         the string.
 * @throws IndexOutOfBoundsException
 *             if {@code start < 0} or {@code start > length()}.
 */
public String substring(int start) {
  if (start == 0) {
    return this;
  }
  if (start >= 0 && start <= count) {
    return new String(offset + start, count - start, value);
  }
  throw indexAndLength(start);
}

代码示例来源:origin: robovm/robovm

/**
 * Returns the Unicode code point that precedes the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 1 || index > length()}
 * @see Character#codePointBefore(char[], int, int)
 * @since 1.5
 */
public int codePointBefore(int index) {
  if (index < 1 || index > count) {
    throw indexAndLength(index);
  }
  return Character.codePointBefore(value, offset + index, offset);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns the character at the specified offset in this string.
 *
 * @param index
 *            the zero-based index in this string.
 * @return the character at the index.
 * @throws IndexOutOfBoundsException
 *             if {@code index < 0} or {@code index >= length()}.
 */
public char charAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return value[offset + index];
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns the character at the specified offset in this string.
 *
 * @param index
 *            the zero-based index in this string.
 * @return the character at the index.
 * @throws IndexOutOfBoundsException
 *             if {@code index < 0} or {@code index >= length()}.
 */
public char charAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return value[offset + index];
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns the character at the specified offset in this string.
 *
 * @param index
 *            the zero-based index in this string.
 * @return the character at the index.
 * @throws IndexOutOfBoundsException
 *             if {@code index < 0} or {@code index >= length()}.
 */
public char charAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return value[offset + index];
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns the character at the specified offset in this string.
 *
 * @param index
 *            the zero-based index in this string.
 * @return the character at the index.
 * @throws IndexOutOfBoundsException
 *             if {@code index < 0} or {@code index >= length()}.
 */
public char charAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return value[offset + index];
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns the Unicode code point at the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 0 || index >= length()}
 * @see Character#codePointAt(char[], int, int)
 * @since 1.5
 */
public int codePointAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return Character.codePointAt(value, offset + index, offset + count);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns the Unicode code point at the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 0 || index >= length()}
 * @see Character#codePointAt(char[], int, int)
 * @since 1.5
 */
public int codePointAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return Character.codePointAt(value, offset + index, offset + count);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns the Unicode code point at the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 0 || index >= length()}
 * @see Character#codePointAt(char[], int, int)
 * @since 1.5
 */
public int codePointAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return Character.codePointAt(value, offset + index, offset + count);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns the Unicode code point at the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 0 || index >= length()}
 * @see Character#codePointAt(char[], int, int)
 * @since 1.5
 */
public int codePointAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return Character.codePointAt(value, offset + index, offset + count);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns the Unicode code point at the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 0 || index >= length()}
 * @see Character#codePointAt(char[], int, int)
 * @since 1.5
 */
public int codePointAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return Character.codePointAt(value, offset + index, offset + count);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Returns the Unicode code point at the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 0 || index >= length()}
 * @see Character#codePointAt(char[], int, int)
 * @since 1.5
 */
public int codePointAt(int index) {
  if (index < 0 || index >= count) {
    throw indexAndLength(index);
  }
  return Character.codePointAt(value, offset + index, offset + count);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns the Unicode code point that precedes the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 1 || index > length()}
 * @see Character#codePointBefore(char[], int, int)
 * @since 1.5
 */
public int codePointBefore(int index) {
  if (index < 1 || index > count) {
    throw indexAndLength(index);
  }
  return Character.codePointBefore(value, offset + index, offset);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns the Unicode code point that precedes the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 1 || index > length()}
 * @see Character#codePointBefore(char[], int, int)
 * @since 1.5
 */
public int codePointBefore(int index) {
  if (index < 1 || index > count) {
    throw indexAndLength(index);
  }
  return Character.codePointBefore(value, offset + index, offset);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Returns the Unicode code point that precedes the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 1 || index > length()}
 * @see Character#codePointBefore(char[], int, int)
 * @since 1.5
 */
public int codePointBefore(int index) {
  if (index < 1 || index > count) {
    throw indexAndLength(index);
  }
  return Character.codePointBefore(value, offset + index, offset);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns the Unicode code point that precedes the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 1 || index > length()}
 * @see Character#codePointBefore(char[], int, int)
 * @since 1.5
 */
public int codePointBefore(int index) {
  if (index < 1 || index > count) {
    throw indexAndLength(index);
  }
  return Character.codePointBefore(value, offset + index, offset);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns the Unicode code point that precedes the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 1 || index > length()}
 * @see Character#codePointBefore(char[], int, int)
 * @since 1.5
 */
public int codePointBefore(int index) {
  if (index < 1 || index > count) {
    throw indexAndLength(index);
  }
  return Character.codePointBefore(value, offset + index, offset);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns the Unicode code point that precedes the given {@code index}.
 *
 * @throws IndexOutOfBoundsException if {@code index < 1 || index > length()}
 * @see Character#codePointBefore(char[], int, int)
 * @since 1.5
 */
public int codePointBefore(int index) {
  if (index < 1 || index > count) {
    throw indexAndLength(index);
  }
  return Character.codePointBefore(value, offset + index, offset);
}

相关文章