Charsequence interface in java lang

Uses of Interface
java.lang.CharSequence

Defines interfaces and classes for the Java virtual machine to access files, file attributes, and file systems.

Provides classes and interfaces for handling text, dates, numbers, and messages in a manner independent of natural languages.

Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.

Classes to support functional-style operations on streams of elements, such as map-reduce transformations on collections.

Facilities for declaring annotation processors and for allowing annotation processors to communicate with an annotation processing tool environment.

Types and hierarchies of packages comprising a Java language model, a model of the declarations and types of the Java programming language.

Uses of CharSequence in com.sun.source.util

Prints a message of the specified kind at the location of the tree within the provided compilation unit

Prints a message of the specified kind at the location of the tree within the provided compilation unit

Uses of CharSequence in java.io

Uses of CharSequence in java.lang

Returns a new String composed of copies of the CharSequence elements joined together with a copy of the specified delimiter .

Returns a new String composed of copies of the CharSequence elements joined together with a copy of the specified delimiter .

Returns the index within the given char sequence that is offset from the given index by codePointOffset code points.

Parses the CharSequence argument as a signed int in the specified radix , beginning at the specified beginIndex and extending to endIndex — 1 .

Parses the CharSequence argument as a signed long in the specified radix , beginning at the specified beginIndex and extending to endIndex — 1 .

Parses the CharSequence argument as an unsigned int in the specified radix , beginning at the specified beginIndex and extending to endIndex — 1 .

Parses the CharSequence argument as an unsigned long in the specified radix , beginning at the specified beginIndex and extending to endIndex — 1 .

Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence.

Returns a new String composed of copies of the CharSequence elements joined together with a copy of the specified delimiter .

Uses of CharSequence in java.net.http

Uses of CharSequence in java.nio

Uses of CharSequence in java.nio.charset

Uses of CharSequence in java.nio.file

Uses of CharSequence in java.text

Uses of CharSequence in java.time

Obtains an instance of ZonedDateTime from a text string such as 2007-12-03T10:15:30+01:00[Europe/Paris] .

Читайте также:  Html not equal to

Uses of CharSequence in java.time.format

Uses of CharSequence in java.util

Sets the sequence of characters to be used when determining the string representation of this StringJoiner and no elements have been added yet, that is, when it is empty.

Constructs a StringJoiner with no characters in it, with no prefix or suffix , and a copy of the supplied delimiter .

Constructs a StringJoiner with no characters in it using copies of the supplied prefix , delimiter and suffix .

Uses of CharSequence in java.util.regex

Uses of CharSequence in java.util.stream

Returns a Collector that concatenates the input elements, separated by the specified delimiter, in encounter order.

Returns a Collector that concatenates the input elements, separated by the specified delimiter, with the specified prefix and suffix, in encounter order.

Returns a Collector that concatenates the input elements, separated by the specified delimiter, in encounter order.

Returns a Collector that concatenates the input elements, separated by the specified delimiter, with the specified prefix and suffix, in encounter order.

Uses of CharSequence in javax.annotation.processing

Prints a message of the specified kind at the location of the annotation mirror of the annotated element.

Prints a message of the specified kind at the location of the annotation value inside the annotation mirror of the annotated element.

Uses of CharSequence in javax.lang.model

Returns whether or not name is a syntactically valid identifier (simple name) or keyword in the latest source version.

Returns whether or not s is a keyword, boolean literal, or null literal in the latest source version.

Uses of CharSequence in javax.lang.model.element

Uses of CharSequence in javax.lang.model.util

Returns a package given its fully qualified name if the package is uniquely determinable in the environment.

Returns a type element given its canonical name if the type element is uniquely determinable in the environment.

Uses of CharSequence in javax.swing.text

Uses of CharSequence in javax.tools

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Interface CharSequence

A CharSequence is a readable sequence of char values. This interface provides uniform, read-only access to many different kinds of char sequences. A char value represents a character in the Basic Multilingual Plane (BMP) or a surrogate. Refer to Unicode Character Representation for details.

This interface does not refine the general contracts of the equals and hashCode methods. The result of testing two objects that implement CharSequence for equality is therefore, in general, undefined. Each object may be implemented by a different class, and there is no guarantee that each class will be capable of testing its instances for equality with those of the other. It is therefore inappropriate to use arbitrary CharSequence instances as elements in a set or as keys in a map.

Читайте также:  Format time from datetime php

Method Summary

Method Details

length

Returns the length of this character sequence. The length is the number of 16-bit char s in the sequence.

charAt

Returns the char value at the specified index. An index ranges from zero to length() — 1 . The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing. If the char value specified by the index is a surrogate, the surrogate value is returned.

isEmpty

subSequence

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end — 1 . The length (in char s) of the returned sequence is end — start , so if start == end then an empty sequence is returned.

toString

Returns a string containing the characters in this sequence in the same order as this sequence. The length of the string will be the length of this sequence.

chars

Returns a stream of int zero-extending the char values from this sequence. Any char which maps to a surrogate code point is passed through uninterpreted. The stream binds to this sequence when the terminal stream operation commences (specifically, for mutable sequences the spliterator for the stream is late-binding). If the sequence is modified during that operation then the result is undefined.

codePoints

Returns a stream of code point values from this sequence. Any surrogate pairs encountered in the sequence are combined as if by Character.toCodePoint and the result is passed to the stream. Any other code units, including ordinary BMP characters, unpaired surrogates, and undefined code units, are zero-extended to int values which are then passed to the stream. The stream binds to this sequence when the terminal stream operation commences (specifically, for mutable sequences the spliterator for the stream is late-binding). If the sequence is modified during that operation then the result is undefined.

compare

Compares two CharSequence instances lexicographically. Returns a negative value, zero, or a positive value if the first sequence is lexicographically less than, equal to, or greater than the second, respectively. The lexicographical ordering of CharSequence is defined as follows. Consider a CharSequence cs of length len to be a sequence of char values, cs[0] to cs[len-1]. Suppose k is the lowest index at which the corresponding char values from each sequence differ. The lexicographic ordering of the sequences is determined by a numeric comparison of the char values cs1[k] with cs2[k]. If there is no such index k, the shorter sequence is considered lexicographically less than the other. If the sequences have the same length, the sequences are considered lexicographically equal.

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Читайте также:  Php вернуть значение массива

Источник

Charsequence interface in java lang

A CharSequence is a readable sequence of char values. This interface provides uniform, read-only access to many different kinds of char sequences. A char value represents a character in the Basic Multilingual Plane (BMP) or a surrogate. Refer to Unicode Character Representation for details. This interface does not refine the general contracts of the equals and hashCode methods. The result of comparing two objects that implement CharSequence is therefore, in general, undefined. Each object may be implemented by a different class, and there is no guarantee that each class will be capable of testing its instances for equality with those of the other. It is therefore inappropriate to use arbitrary CharSequence instances as elements in a set or as keys in a map.

Method Summary

Method Detail

length

Returns the length of this character sequence. The length is the number of 16-bit char s in the sequence.

charAt

Returns the char value at the specified index. An index ranges from zero to length() - 1. The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing. If the char value specified by the index is a surrogate, the surrogate value is returned.

subSequence

CharSequence subSequence(int start, int end)

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in char s) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

toString

Returns a string containing the characters in this sequence in the same order as this sequence. The length of the string will be the length of this sequence.

chars

Returns a stream of int zero-extending the char values from this sequence. Any char which maps to a surrogate code point is passed through uninterpreted. If the sequence is mutated while the stream is being read, the result is undefined.

codePoints

Returns a stream of code point values from this sequence. Any surrogate pairs encountered in the sequence are combined as if by Character.toCodePoint and the result is passed to the stream. Any other code units, including ordinary BMP characters, unpaired surrogates, and undefined code units, are zero-extended to int values which are then passed to the stream. If the sequence is mutated while the stream is being read, the result is undefined.

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2023, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.

Источник

Оцените статью