Stay organized with collections
Save and categorize content based on your preferences.
Subset
class Subset
Instances of this class represent particular subsets of the Unicode character set. The only family of subsets defined in the Character
class is Character.UnicodeBlock
. Other portions of the Java API may define other subsets for their own purposes.
Summary
Protected constructors |
Constructs a new Subset instance.
|
Public methods |
Boolean |
Compares two Subset objects for equality.
|
Int |
Returns the standard hash code as defined by the Object.hashCode method.
|
String |
Returns the name of this subset.
|
Protected constructors
Subset
protected Subset(name: String)
Constructs a new Subset
instance.
Parameters |
name |
String: The name of this subset |
Exceptions |
java.lang.NullPointerException |
if name is null |
Public methods
equals
fun equals(other: Any?): Boolean
Compares two Subset
objects for equality. This method returns true
if and only if this
and the argument refer to the same object; since this method is final
, this guarantee holds for all subclasses.
Parameters |
obj |
the reference object with which to compare. |
Return |
Boolean |
true if this object is the same as the obj argument; false otherwise. |
hashCode
fun hashCode(): Int
Returns the standard hash code as defined by the Object.hashCode
method. This method is final
in order to ensure that the equals
and hashCode
methods will be consistent in all subclasses.
Return |
Int |
a hash code value for this object. |
toString
fun toString(): String
Returns the name of this subset.
Return |
String |
a string representation of the object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Character.Subset\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nSubset\n======\n\n```\nclass Subset\n```\n\n|---|---------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [java.lang.Character.Subset](#) |\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [Character.UnicodeBlock](/reference/kotlin/java/lang/Character.UnicodeBlock), [UCharacter.UnicodeBlock](../../android/icu/lang/UCharacter.UnicodeBlock.html#) |---------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------| | [Character.UnicodeBlock](/reference/kotlin/java/lang/Character.UnicodeBlock) | A family of character subsets representing the character blocks in the Unicode specification. | | [UCharacter.UnicodeBlock](../../android/icu/lang/UCharacter.UnicodeBlock.html#) | **\\[icu enhancement\\]** ICU's replacement for [java.lang.Character.UnicodeBlock](/reference/kotlin/java/lang/Character.UnicodeBlock). | |\n\nInstances of this class represent particular subsets of the Unicode character set. The only family of subsets defined in the `Character` class is [Character.UnicodeBlock](/reference/kotlin/java/lang/Character.UnicodeBlock). Other portions of the Java API may define other subsets for their own purposes.\n\nSummary\n-------\n\n| Protected constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Subset](#Subset(kotlin.String))`(`name:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Constructs a new `Subset` instance. |\n\n| Public methods ||\n|------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Compares two `Subset` objects for equality. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [hashCode](#hashCode())`()` Returns the standard hash code as defined by the [Object.hashCode](/reference/kotlin/java/lang/Object#hashCode()) method. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` Returns the name of this subset. |\n\nProtected constructors\n----------------------\n\n### Subset\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nprotected Subset(name: String)\n```\n\nConstructs a new `Subset` instance.\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------------------------------|\n| `name` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The name of this subset |\n\n| Exceptions ||\n|----------------------------------|-------------------|\n| `java.lang.NullPointerException` | if name is `null` |\n\nPublic methods\n--------------\n\n### equals\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun equals(other: Any?): Boolean\n```\n\nCompares two `Subset` objects for equality. This method returns `true` if and only if `this` and the argument refer to the same object; since this method is `final`, this guarantee holds for all subclasses.\n\n| Parameters ||\n|-------|---------------------------------------------|\n| `obj` | the reference object with which to compare. |\n\n| Return ||\n|------------------------------------------------------------------------------------|---------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true` if this object is the same as the obj argument; `false` otherwise. |\n\n### hashCode\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun hashCode(): Int\n```\n\nReturns the standard hash code as defined by the [Object.hashCode](/reference/kotlin/java/lang/Object#hashCode()) method. This method is `final` in order to ensure that the `equals` and `hashCode` methods will be consistent in all subclasses.\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |\n\n### toString\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\nReturns the name of this subset.\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |"]]