# Character.Subset

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Subset

```
class Subset
```

|---|----------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                           ||
| ↳ | [java.lang.Character.Subset](https://developer.android.com/reference/kotlin/java/lang/Character.Subset#) |

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known Direct Subclasses [Character.UnicodeBlock](https://developer.android.com/reference/kotlin/java/lang/Character.UnicodeBlock),[UCharacter.UnicodeBlock](https://developer.android.com/reference/kotlin/android/icu/lang/UCharacter.UnicodeBlock.html#) |--------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Character.UnicodeBlock](https://developer.android.com/reference/kotlin/java/lang/Character.UnicodeBlock)                | A family of character subsets representing the character blocks in the Unicode specification.                                                                     | | [UCharacter.UnicodeBlock](https://developer.android.com/reference/kotlin/android/icu/lang/UCharacter.UnicodeBlock.html#) | **\[icu enhancement\]** ICU's replacement for[java.lang.Character.UnicodeBlock](https://developer.android.com/reference/kotlin/java/lang/Character.UnicodeBlock). | |

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](https://developer.android.com/reference/kotlin/java/lang/Character.UnicodeBlock). Other portions of the Java API may define other subsets for their own purposes.

## Summary

|                                                                                                            Protected constructors                                                                                                            ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Subset](https://developer.android.com/reference/kotlin/java/lang/Character.Subset#Subset(kotlin.String))`(`name:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Constructs a new`Subset`instance. |

|                                                                                                                                                                Public methods                                                                                                                                                                 ||
|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/java/lang/Character.Subset#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Compares two`Subset`objects for equality.                |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [hashCode](https://developer.android.com/reference/kotlin/java/lang/Character.Subset#hashCode())`()` Returns the standard hash code as defined by the[Object.hashCode](https://developer.android.com/reference/kotlin/java/lang/Object#hashCode())method. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)   | [toString](https://developer.android.com/reference/kotlin/java/lang/Character.Subset#toString())`()` Returns the name of this subset.                                                                                                                     |

## Protected constructors

### Subset

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
protected Subset(name: String)
```

Constructs a new`Subset`instance.

|                                                    Parameters                                                    ||
|--------|----------------------------------------------------------------------------------------------------------|
| `name` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):The name of this subset |

|                     Exceptions                     ||
|----------------------------------|------------------|
| `java.lang.NullPointerException` | if name is`null` |

## Public methods

### equals

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if this object is the same as the obj argument;`false`otherwise. |

### hashCode

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hashCode(): Int
```

Returns the standard hash code as defined by the[Object.hashCode](https://developer.android.com/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.

|                                                     Return                                                     ||
|----------------------------------------------------------------------------|------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |

### toString

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun toString(): String
```

Returns the name of this subset.

|                                                          Return                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |