# Business Logic — KKW00801SF01DBean.removeElementFromListData() [20 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00801SF.KKW00801SF01DBean` |
| Layer | View / Data Bean (webview) |
| Module | `KKW00801SF` (Package: `eo.web.webview.KKW00801SF`) |

## 1. Role

### KKW00801SF01DBean.removeElementFromListData()

This method provides a **view-layer list-item removal utility** for telecom service configuration screens within the KKW00801SF (Mail NOS / Mail Volume / Virus Check) business module. It operates as a **discriminated dispatcher**: given a string key that identifies a specific typed-list field on the screen, and an integer index identifying which row to remove, it routes the removal to the correct `X33VDataTypeList` instance. The method handles two distinct data type view items — "Mail NOS Capacity Selection List" (メールNOS容量選択リスト) for mail volume tier configuration entries, and "Virus Check Selection List" (ウィルスチェック選択リスト) for virus check option entries. It implements a **routing pattern** using string comparison on the key to select the target list, then performs a **bounds-checked deletion** on the selected list's underlying ArrayList. As a shared utility method, it is defined once in `KKW00801SF01DBean` and inherited (via `super.removeElementFromListData(key, index)`) by dozens of DBean subclasses across many screens (FUW009xx, CRW066xx, KKW12xx, KKW18xx, CHW011xx, etc.), making it a **central shared component** in the webview data-bean hierarchy. If `key` is null, the method returns silently (no-op). If the key does not match any known list name, it also returns silently — there is no error thrown for unrecognized keys.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["removeElementFromListData key, index"])
    CHECK_NULL["key != null ?"]
    CHECK_MLBOX["key equals メールNOS容量選択リスト"]
    ML_BOUNDS["index >= 0 && index < mlbox_cap_op_list_list.size()"]
    ML_REMOVE["mlbox_cap_op_list_list.remove(index)"]
    CHECK_VIRUS["key equals ウィルスチェック選択リスト"]
    VIRUS_BOUNDS["index >= 0 && index < virus_chk_op_list_list.size()"]
    VIRUS_REMOVE["virus_chk_op_list_list.remove(index)"]
    END_RETURN(["Return / Done"])

    START --> CHECK_NULL
    CHECK_NULL -->|true| CHECK_MLBOX
    CHECK_NULL -->|false| END_RETURN
    CHECK_MLBOX -->|true| ML_BOUNDS
    CHECK_MLBOX -->|false| CHECK_VIRUS
    ML_BOUNDS -->|true| ML_REMOVE
    ML_BOUNDS -->|false| CHECK_VIRUS
    ML_REMOVE --> CHECK_VIRUS
    CHECK_VIRUS -->|true| VIRUS_BOUNDS
    CHECK_VIRUS -->|false| END_RETURN
    VIRUS_BOUNDS -->|true| VIRUS_REMOVE
    VIRUS_BOUNDS -->|false| END_RETURN
    VIRUS_REMOVE --> END_RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business name of the list field from which to remove an element. Identifies which typed list to modify. Values: `"メールNOS容量選択リスト"` (Mail NOS Capacity Selection List — contains mail volume capacity tier entries for NOS/Network Operating System service configuration), or `"ウィルスチェック選択リスト"` (Virus Check Selection List — contains virus check option configuration entries). If `null`, the method returns immediately with no effect. If set to any other string, the method returns silently (no matching branch). |
| 2 | `index` | `int` | The zero-based index of the element to remove from the identified list. Must be within the bounds `[0, size-1]` of the target list. If out of bounds, the removal is skipped silently (no `IndexOutOfBoundsException` is caught or thrown by this method — the `List.remove(int)` call handles bounds checking internally and throws the exception if violated). |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `mlbox_cap_op_list_list` | `X33VDataTypeList` | Mail NOS Capacity Selection List — stores the list of selectable mail volume capacity tier entries displayed on the screen. Each entry is a `X33VDataTypeBeanInterface` item. |
| `virus_chk_op_list_list` | `X33VDataTypeList` | Virus Check Selection List — stores the list of selectable virus check option entries. Each entry is a `X33VDataTypeBeanInterface` item. |

## 4. CRUD Operations / Called Services

This method performs **in-memory list mutation only** — it does not invoke any SC (Service Component), CBS (Common Business Service), or database operations. It delegates to the Java `java.util.List.remove(int)` method on its internal list fields.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | `List.remove(int)` (JDK `java.util.ArrayList`) | — | N/A (in-memory) | Deletes an element at the specified index from the in-memory `X33VDataTypeList` (wrapping an `ArrayList`). No database or service-layer call. |

## 5. Dependency Trace

This method is defined in `KKW00801SF01DBean` and inherited/overridden by many DBean subclasses across the webview layer. Most subclasses delegate to it via `super.removeElementFromListData(key, index)` in their own override. Many other DBean classes define a copy of this method (identical implementation). Below are key callers found in the codebase that reference or override this method.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW00801SF | `KKW00801SF01DBean.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 2 | Screen:KKW12701SF | `KKW12701SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 3 | Screen:KKW10702SF | `KKW10702SF01DBean.removeElementFromListData(key, index)` (inherits base impl) | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 4 | Screen:KKW10702SF | `KKW10702SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 5 | Screen:KKW18701SF | `KKW18701SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 6 | Screen:KKW12702SF | `KKW12702SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 7 | Screen:KKW00198SF | `KKW00198SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 8 | Screen:KKW00825SF | `KKW00825SF02DBean.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 9 | Screen:KKW00828SF | `KKW00828SF01DBean.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 10 | Screen:KKW00834SF | `KKW00834SF01DBean.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 11 | Screen:KKW00831SF | `KKW00831SF01DBean.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 12 | Screen:KKW00846SF | `KKW00846SF01DBean.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 13 | Screen:CRW06601SF | `CRW06601SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 14 | Screen:CRW05005SF | `CRW05005SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 15 | Screen:CHW01110SF | `CHW01110SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 16 | Screen:DKW00801SF | `DKW00801SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 17 | Screen:FUW00901SF | `FUW00901SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 18 | Screen:FUW00907SF | `FUW00907SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 19 | Screen:FUW00912SF | `FUW00912SF01DBean.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |
| 20 | Screen:FUW00917SF | `FUW00917SFBean.removeElementFromListData(key, index) -> super.removeElementFromListData(key, index)` | `List.remove(int) [D] mlbox_cap_op_list_list / virus_chk_op_list_list` |

## 6. Per-Branch Detail Blocks

**Block 1** — IF (null check) `(key != null)` (L1341)

> If `key` is `null`, skip all processing entirely — no-op. This is a guard clause to prevent `NullPointerException` on the subsequent `key.equals(...)` calls.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key != null)` // Guard: skip processing if key is null [-> N/A] |

**Block 1.1** — IF-ELSE-IF (ML NOS Capacity list branch) `(key.equals("メールNOS容量選択リスト"))` (L1343)

> Business description: Removes an element from the Mail NOS Capacity Selection List. This list holds the selectable mail volume capacity tier options for the NOS/Network Operating System mail service. "メールNOS容量選択リスト" (メールNOS容量選択リスト) means "Mail NOS Capacity Selection List" — it is the display name of the data type view item.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key.equals("メールNOS容量選択リスト"))` // "Mail NOS Capacity Selection List" (データタイプビュー項目 メールNOS容量選択リスト, 項目ID:mlbox_cap_op_list) [-> MLBOX_CAP_OPLIST_KEY="メールNOS容量選択リスト"] |

**Block 1.1.1** — IF (bounds check for ML list) `(index >= 0 && index < mlbox_cap_op_list_list.size())` (L1344)

> Business description: Validates that the specified index falls within the valid range of the current list before performing removal. "指定のインデックスが現在のリストの範囲内なら、そのインデックスの内容を削除する" means "If the specified index is within the current list range, remove the content at that index."

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (index >= 0 && index < mlbox_cap_op_list_list.size())` // 指定のインデックスが現在のリストの範囲内なら、そのインデックスの内容を削除する (If the specified index is within the current list range, remove the content at that index) [-> N/A] |
| 2 | EXEC | `mlbox_cap_op_list_list.remove(index)` // Delete the element at the given index from the list [-> D mlbox_cap_op_list_list (in-memory X33VDataTypeList)] |

**Block 1.2** — ELSE-IF (Virus Check list branch) `(key.equals("ウィルスチェック選択リスト"))` (L1350)

> Business description: Removes an element from the Virus Check Selection List. This list holds the selectable virus check option entries. "ウィルスチェック選択リスト" (ウィルスチェック選択リスト) means "Virus Check Selection List" — it is the display name of the data type view item.

| # | Type | Code |
|---|------|------|
| 1 | IF | `else if (key.equals("ウィルスチェック選択リスト"))` // ウィルスチェック選択リスト (データタイプビュー項目 ウィルスチェック選択リスト, 項目ID:virus_chk_op_list) [-> VIRUS_CHK_OPLIST_KEY="ウィルスチェック選択リスト"] |

**Block 1.2.1** — IF (bounds check for Virus list) `(index >= 0 && index < virus_chk_op_list_list.size())` (L1351)

> Business description: Validates that the specified index falls within the valid range of the current list before performing removal. "指定のインデックスが現在のリストの範囲内なら、そのインデックスの内容を削除する" means "If the specified index is within the current list range, remove the content at that index."

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (index >= 0 && index < virus_chk_op_list_list.size())` // 指定のインデックスが現在のリストの範囲内なら、そのインデックスの内容を削除する (If the specified index is within the current list range, remove the content at that index) [-> N/A] |
| 2 | EXEC | `virus_chk_op_list_list.remove(index)` // Delete the element at the given index from the list [-> D virus_chk_op_list_list (in-memory X33VDataTypeList)] |

**Block 2** — ELSE (no matching key, L1335–1354)

> If `key` is `null` (Block 1 is false) or `key` does not match either known list name, the method returns immediately with no side effects. This silent no-op behavior means the method is safe to call with any key without raising an error for unrecognized values.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mlbox_cap_op_list_list` | Field | Mail NOS Capacity Selection List — in-memory list of selectable mail volume capacity tier entries for NOS/Network Operating System mail service configuration. |
| `virus_chk_op_list_list` | Field | Virus Check Selection List — in-memory list of selectable virus check option entries displayed on the screen. |
| メールNOS容量選択リスト | Japanese field | Mail NOS Capacity Selection List — the display name of the data type view item that holds mail volume capacity tier options. "メール" = Mail, "NOS" = Network Operating System, "容量" = Capacity/Volume, "選択" = Selection, "リスト" = List. |
| ウィルスチェック選択リスト | Japanese field | Virus Check Selection List — the display name of the data type view item that holds virus check option entries. "ウィルス" = Virus, "チェック" = Check, "選択" = Selection, "リスト" = List. |
| X33VDataTypeList | Class | A typed list wrapper (extends `java.util.List`) that holds `X33VDataTypeBeanInterface` items. Used throughout the K-Opticom webview framework for screen-bound list data. |
| X33VDataTypeBeanInterface | Interface | The interface implemented by individual items within an `X33VDataTypeList`. Provides `loadModelData(String key, String field)` for retrieving field values from each list item. |
| DBean | Acronym | Data Bean — a view-layer JavaBean that holds the state and data for a screen. Inherits from base DBean classes and delegates to parent implementations for shared utility methods. |
| NOS | Acronym | Network Operating System — in this context, a mail service platform managed by K-Opticom. |
| ML | Acronym | Mail — used in field names (e.g., `mlbox_cap_op_list_list`). |
| 項目名 (key) | Japanese field | Item name — the business-identifying string key used to route to the correct list. Also referred to as "項目ID" (Item ID) in comments. |
| インデックス番 (index) | Japanese field | Index number — the zero-based position within the list of the element to remove. |
| リスト項目のインスタンスを削除します | Japanese javadoc | "Removes an instance of a list item" — the method's documented purpose. |
| データタイプビュー項目 | Japanese comment | Data Type View Item — a category of screen field that renders as a typed list UI component (selectable options). |
