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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA16601SF.KKW00128SF01DBean` |
| Layer | Common Component / Utility (Base bean providing shared list-manipulation helpers for web screen beans) |
| Module | `KKA16601SF` (Package: `eo.web.webview.KKA16601SF`) |

## 1. Role

### KKW00128SF01DBean.removeElementFromListData()

This method provides a **shared utility for removing individual elements from typed list data collections** on the web presentation layer. It is defined in `KKW00128SF01DBean`, which serves as a base data bean (`DBean`) that many screen-specific beans extend via inheritance (`super.removeElementFromListData(...)`). The method implements a **string-key-based routing/dispatch pattern**: it inspects the `key` parameter against hard-coded Japanese display names to determine which internal `X33VDataTypeList` to mutate — either `ido_rsn_cd_list` (異動理由コード / Movement Reason Code list) or `op_svc_kei_no_list` (オプションサービス契約番号 / Option Service Contract Number list). For each branch, it performs a **bounds-checked removal** (`index >= 0 && index < list.size()`) before mutating the list, preventing `IndexOutOfBoundsException` at the presentation tier. The method has no external dependencies — no database, no SC/CBS calls, no entity reads or writes — making it a pure in-memory list state mutator used across dozens of screens (20+ `FUW*` screen beans and 10+ `KKW*` screen beans reference it). Its role in the larger system is to provide a centralized, type-safe way for screen beans to remove specific rows from their list data without each screen having to duplicate the same null-check and bounds-check logic.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["removeElementFromListData(key, index)"])
    START --> CHECK_NULL["key is null?"]
    CHECK_NULL -->|null| END_RETURN(["Return"])
    CHECK_NULL -->|not null| CHECK_KEY1["key equals \\u7570\\u52d5\\u7406\\u7531\\u30b3\\u30fc\\u30c9?"]
    CHECK_KEY1 -->|yes| CHECK_IDX1["index in range of ido_rsn_cd_list?"]
    CHECK_IDX1 -->|yes| REMOVE1["ido_rsn_cd_list.remove(index)"]
    CHECK_IDX1 -->|no| END_RETURN
    REMOVE1 --> END_RETURN
    CHECK_KEY1 -->|no| CHECK_KEY2["key equals \\u30aa\\u30d7\\u30b7\\u30e7\\u30f3\\u30b5\\u30fc\\u30d3\\u30b9\\u5951\\u7d04\\u756a\\u53f7?"]
    CHECK_KEY2 -->|yes| CHECK_IDX2["index in range of op_svc_kei_no_list?"]
    CHECK_IDX2 -->|yes| REMOVE2["op_svc_kei_no_list.remove(index)"]
    CHECK_IDX2 -->|no| END_RETURN
    REMOVE2 --> END_RETURN
    CHECK_KEY2 -->|no| END_RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | A human-readable Japanese display name that identifies which list data collection to mutate. It acts as a routing key to dispatch to the correct internal list. Valid values are: `"異動理由コード"` (ido_rsn_cd — Movement Reason Code, used to classify the reason for a service change/movement) and `"オプションサービス契約番号"` (op_svc_kei_no — Option Service Contract Number, used to identify add-on service subscriptions). If the key is `null` or does not match any known key, the method performs a no-op. |
| 2 | `index` | `int` | The zero-based index of the element to remove from the identified list. Used as a positional selector so screens can remove a specific row that the user interacted with (e.g., clicking a "delete" button on a list row). The method validates that `index` is within the bounds of the target list (`0 <= index < size`) before removing, silently skipping the removal if out of range. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `ido_rsn_cd_list` | `X33VDataTypeList` | List of movement reason codes (異動理由コード) — stores String-type reason codes explaining why a service was moved/changed. Internal item ID: `ido_rsn_cd`. |
| `op_svc_kei_no_list` | `X33VDataTypeList` | List of option service contract numbers (オプションサービス契約番号) — stores String-type identifiers for optional/add-on service subscriptions. Internal item ID: `op_svc_kei_no`. |

## 4. CRUD Operations / Called Services

This method performs **no database or service-component operations**. It is a pure in-memory list manipulation utility. The `List.remove(int)` operation mutates local bean state but does not constitute a persistent CRUD operation against any entity or database table.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| *(none)* | — | — | — | This method is a presentation-tier list mutator with no SC, CBS, Entity, or DB access. |

## 5. Dependency Trace

This method is a **shared base-bean utility** called by many screen beans via `super.removeElementFromListData(key, index)`. It is invoked by **39 screen beans** across both the `koptWebA` (new contract) and `koptWebR` (renewal/change) web application modules, covering the `FUW*` and `KKW*` screen families. All callers pass `super.` to delegate to this base implementation.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: FUW00901 | `FUW00901SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 2 | Screen: FUW00902 | `FUW00902SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 3 | Screen: FUW00903 | `FUW00903SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 4 | Screen: FUW00905 | `FUW00905SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 5 | Screen: FUW00906 | `FUW00906SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 6 | Screen: FUW00907 | `FUW00907SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 7 | Screen: FUW00908 | `FUW00908SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 8 | Screen: FUW00909 | `FUW00909SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 9 | Screen: FUW00910 | `FUW00910SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 10 | Screen: FUW00911 | `FUW00911SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 11 | Screen: FUW00912 | `FUW00912SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 12 | Screen: FUW00913 | `FUW00913SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 13 | Screen: FUW00914 | `FUW00914SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 14 | Screen: FUW00915 | `FUW00915SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |
| 15 | Screen: FUW00916 | `FUW00916SFBean.removeElementFromListData(key, index)` → `super.removeElementFromListData(key, index)` | — |

**Note:** The caller search identified 39 additional screen beans (including `KKW00128SFBean`, `KKW00129SFBean`, `KKW00825SFBean`, `KKW00828SFBean`, `KKW01024SFBean`, `KKW01027SFBean`, `KKW02501SFBean`, `KKW02516SFBean`, `KKW03204SFBean`, `KKW13701SFBean`, `KKW14301SFBean`, `CKW00401SFBean`, and many `FUW*` beans) that all follow the identical delegation pattern. This is the definitive shared utility base method for list-element removal across the telecom web application's contract management screens.

## 6. Per-Branch Detail Blocks

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

> Guard clause: if `key` is `null`, the method returns immediately without performing any list operation. This prevents `NullPointerException` from the subsequent `key.equals(...)` calls.

| # | Type | Code |
|---|------|------|
| 1 | SET | *(implicit)* — `key` is the method parameter, type `String` |
| 2 | EXEC | `if (key != null)` — guard against null key [-> No-op when null] |

**Block 2** — IF `(key.equals("異動理由コード"))` (L1640)

> Branch: when the key matches the Japanese display name for "Movement Reason Code" (異動理由コード), target the `ido_rsn_cd_list` collection. This list stores reason codes for service changes/movements.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `key.equals("異動理由コード")` — route to movement reason code list [-> Constant: "異動理由コード" (Movement Reason Code), internal ID: `ido_rsn_cd`] |
| 2 | EXEC | Conditional entry into bounds-check block |

**Block 2.1** — IF `(index >= 0 && index < ido_rsn_cd_list.size())` (L1641)

> Nested check: validates that the provided `index` falls within the valid range of the `ido_rsn_cd_list`. If in range, removes the element at that position. If out of range, silently skips the removal.

| # | Type | Code |
|---|------|------|
| 1 | SET | `index >= 0` — lower bound check |
| 2 | SET | `index < ido_rsn_cd_list.size()` — upper bound check |
| 3 | CALL | `ido_rsn_cd_list.remove(index)` — removes element at the specified index from the movement reason code list [-> No DB operation; in-memory list mutation only] |

**Block 3** — ELSE-IF `(key.equals("オプションサービス契約番号"))` (L1646)

> Branch: when the key matches the Japanese display name for "Option Service Contract Number" (オプションサービス契約番号), target the `op_svc_kei_no_list` collection. This list stores contract numbers for optional/add-on service subscriptions.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `key.equals("オプションサービス契約番号")` — route to option service contract list [-> Constant: "オプションサービス契約番号" (Option Service Contract Number), internal ID: `op_svc_kei_no`] |
| 2 | EXEC | Conditional entry into bounds-check block |

**Block 3.1** — IF `(index >= 0 && index < op_svc_kei_no_list.size())` (L1647)

> Nested check: validates that the provided `index` falls within the valid range of the `op_svc_kei_no_list`. If in range, removes the element at that position. If out of range, silently skips the removal.

| # | Type | Code |
|---|------|------|
| 1 | SET | `index >= 0` — lower bound check |
| 2 | SET | `index < op_svc_kei_no_list.size()` — upper bound check |
| 3 | CALL | `op_svc_kei_no_list.remove(index)` — removes element at the specified index from the option service contract number list [-> No DB operation; in-memory list mutation only] |

**Block 4** — IMPLICIT ELSE (no matching key) (L1649)

> Fallback: if `key` is not `null` but does not match any known list identifier, the method completes without any action. This is an intentional no-op — unknown keys are silently ignored rather than throwing an exception, providing defensive behavior for screens that may pass unrecognized keys.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | Implicit return (void method) [-> No side effects, no-op] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `異動理由コード` | Field | Movement Reason Code — Japanese display name for the key that routes to the `ido_rsn_cd_list`; stores codes explaining why a service was moved or changed |
| `ido_rsn_cd` | Field | Internal item ID for movement reason code — the programmatic identifier corresponding to the display name "異動理由コード" |
| `オプションサービス契約番号` | Field | Option Service Contract Number — Japanese display name for the key that routes to the `op_svc_kei_no_list`; stores contract numbers for add-on service subscriptions |
| `op_svc_kei_no` | Field | Internal item ID for option service contract number — the programmatic identifier corresponding to the display name "オプションサービス契約番号" |
| `X33VDataTypeList` | Type | Fujitsu X33 framework typed list — a strongly-typed Java collection used within the X33 web framework for managing screen-level list data with type safety |
| `KKW00128SF01DBean` | Class | Data bean class — base class providing shared list-data management utilities (initialization, clearing, removal) for the KKA16601SF (new service contract) screen module |
| Screen bean | Pattern | A Java class extending a base DBean or VBean that holds UI state for a specific screen; all callers of this method are screen beans (FUW* or KKW*) |
| `X33SException` | Type | X33 framework service exception — the checked exception type declared in the method signature, though this particular implementation does not throw it |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service; primary service type handled by K-Opticom's contract management system |
| Option Service (オプションサービス) | Business term | Additional/auxiliary services subscribed alongside a primary contract (e.g., security services, storage upgrades, premium support) |
| DBean | Pattern | Data Bean — a JavaBean class that holds data state for a screen, typically implementing `X33VDataTypeBeanInterface` for type-safe data binding |
| Super delegation | Pattern | Calling `super.method()` to invoke the parent class's implementation; all callers delegate to this base method rather than re-implementing the logic |
