Processing:Справочник языка Processing/IntDict/hasKey(): различия между версиями
Материал из Онлайн справочника
Перейти к навигацииПерейти к поиску
Myagkij (обсуждение | вклад) Нет описания правки |
Нет описания правки |
||
Строка 2: | Строка 2: | ||
{{Myagkij-редактор}} | {{Myagkij-редактор}} | ||
= hasKey() <ref>[https://processing.org/reference/IntDict_hasKey_.html processing.org - hasKey()]</ref>= | = hasKey() <ref>[https://processing.org/reference/IntDict_hasKey_.html processing.org - hasKey()]</ref>= | ||
Строка 8: | Строка 8: | ||
==Обозначение== | ==Обозначение== | ||
<syntaxhighlight lang="c | <syntaxhighlight lang="c"> | ||
hasKey() | hasKey() | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Строка 18: | Строка 18: | ||
==Синтаксис== | ==Синтаксис== | ||
<syntaxhighlight lang="c | <syntaxhighlight lang="c"> | ||
.hasKey(key) | .hasKey(key) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Строка 24: | Строка 24: | ||
==Параметры== | ==Параметры== | ||
<syntaxhighlight lang="c | <syntaxhighlight lang="c"> | ||
key - тип String: ключ | key - тип String: ключ | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Строка 30: | Строка 30: | ||
==Возвращаемое значение== | ==Возвращаемое значение== | ||
<syntaxhighlight lang="c | <syntaxhighlight lang="c"> | ||
boolean | boolean | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Строка 36: | Строка 36: | ||
==Пример== | ==Пример== | ||
<syntaxhighlight lang="c" line="GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS | <syntaxhighlight lang="c" line="GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS"> | ||
IntDict inventory; | IntDict inventory; | ||
Строка 75: | Строка 75: | ||
|Высота логотипа издателя для schemaNewsArticle=45 | |Высота логотипа издателя для schemaNewsArticle=45 | ||
}} | }} | ||
{{Навигационная таблица/ | {{Навигационная таблица/Портал/Processing}} |
Версия от 12:03, 20 мая 2023
Содержание | Среда разработки Processing | Справочник языка Processing | Библиотеки | Примеры | Режимы программирования |
Проверка/Оформление/Редактирование: Мякишев Е.А.
hasKey() [1]
Обозначение
hasKey()
Описание
Проверяет, является ли ключ частью структуры данных.
Синтаксис
.hasKey(key)
Параметры
key - тип String: ключ
Возвращаемое значение
boolean
Пример
IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
inventory.set("cd", 84);
inventory.set("tapes", 15);
inventory.set("records", 102);
println(inventory);
if (inventory.hasKey("records") == true) {
println("Yes, we have records.");
} else {
println("Sorry, no records.");
}
}
См.также
Внешние ссылки
Примеры на Processing | |
---|---|
Основы |
|
Продвинутые графические эффекты |
|
Примеры из сторонних библиотек |