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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00127SF.KKW00127SF02DBean` |
| Layer | Utility / Base Bean Component (Package: `eo.web.webview.KKW00127SF`) |
| Module | `KKW00127SF` (Package: `eo.web.webview.KKW00127SF`) |

## 1. Role

### KKW00127SF02DBean.removeElementFromListData()

This method is a shared utility for removing a single element from typed lists within the web screen bean data model. It operates as a string-key-based dispatcher: given a natural-language list identifier (`key`) and a zero-based index, it locates the corresponding list on the bean instance and removes the element at that position. It supports two service-domain lists — the **Service Contract Status List** (`svc_kei_stat_lis_list`) and the **Introduction Code List** (`intr_cd_list_list`) — enabling screens to dynamically remove items from these collections during user interactions such as cancelling a selected service status or un-linking an introduction code entry. The method implements a routing/dispatch design pattern over hardcoded string keys, serving as a common helper across all subclass screen beans in the `KKW00127SF` module. As a `protected` (public) base-bean method with no external callers, its role in the larger system is to provide a safe, index-bounded removal operation that subclasses inherit and invoke internally.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["removeElementFromListData String key int index"])
    CHECK_NULL{key is not null}
    CHECK_KEY1{key equals
サービス契約ステータスリスト}
    CHECK_IDX1{index >= 0 and
index < svc_kei_stat_lis_list.size}
    REMOVE1[svc_kei_stat_lis_list.remove index]
    CHECK_KEY2{key equals
紹介コードリスト}
    CHECK_IDX2{index >= 0 and
index < intr_cd_list_list.size}
    REMOVE2[intr_cd_list_list.remove index]
    END_NODE(["Return / Next"])

    START --> CHECK_NULL
    CHECK_NULL -->|false| END_NODE
    CHECK_NULL -->|true| CHECK_KEY1
    CHECK_KEY1 -->|false| CHECK_KEY2
    CHECK_KEY1 -->|true| CHECK_IDX1
    CHECK_IDX1 -->|false| END_NODE
    CHECK_IDX1 -->|true| REMOVE1
    REMOVE1 --> CHECK_KEY2
    CHECK_KEY2 -->|false| END_NODE
    CHECK_KEY2 -->|true| CHECK_IDX2
    CHECK_IDX2 -->|false| END_NODE
    CHECK_IDX2 -->|true| REMOVE2
    REMOVE2 --> END_NODE
```

**Branch summary:**

| Branch | Condition | Action |
|--------|-----------|--------|
| Null guard | `key` is null | Silently returns (no-op) |
| Branch 1 | `key` equals `"サービス契約ステータスリスト"` (Service Contract Status List) | Removes element at `index` from `svc_kei_stat_lis_list` (after bounds check) |
| Branch 2 | `key` equals `"紹介コードリスト"` (Introduction Code List) | Removes element at `index` from `intr_cd_list_list` (after bounds check) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The natural-language list identifier that determines which typed list to remove from. It selects the target collection by matching against hardcoded keys: `"サービス契約ステータスリスト"` (Service Contract Status List, item ID: `svc_kei_stat_lis`) or `"紹介コードリスト"` (Introduction Code List, item ID: `intr_cd_list`). If `null`, the method performs a no-op. |
| 2 | `index` | `int` | The zero-based position of the element to remove from the target list. Must satisfy `0 <= index < list.size()`. If out of bounds, the method silently returns without modifying the list. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `svc_kei_stat_lis_list` | `X33VDataTypeList` | Service Contract Status List — holds status entries for service contract line items |
| `intr_cd_list_list` | `X33VDataTypeList` | Introduction Code List — holds introduction/referral code entries associated with the screen |

## 4. CRUD Operations / Called Services

This method performs **in-memory list mutations only**. It does not invoke any SC (Service Component), CBS (Business Service), or database operations. It directly manipulates Java `List` objects on the bean instance.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| N/A | `List.remove(int)` | — | — (in-memory `List`) | Removes an element at a given index from the target `X33VDataTypeList` via Java's `ArrayList.remove()` (or equivalent). No SC/CBS/DB involvement. |

## 5. Dependency Trace

No external callers were found in the codebase. All references to this method are **subclass overrides** that invoke `super.removeElementFromListData(key, index)` to extend or delegate to this base implementation. The method is inherited by the following subclasses:

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class: `KKW00127SFBean` | `KKW00127SFBean.removeElementFromListData` -> `super.removeElementFromListData(key, index)` | (inherited base — no external caller) |
| 2 | Class: `KKW00127SF01DBean` | `KKW00127SF01DBean.removeElementFromListData` (override at L457) | (inherited base — no external caller) |
| 3 | Class: `KKW00127SF02DBean` | `KKW00127SF02DBean.removeElementFromListData` (own implementation at L947) | (own implementation) |
| 4 | Class: `KKW00127SF04DBean` | `KKW00127SF04DBean.removeElementFromListData` (override at L1295) | (inherited base — no external caller) |
| 5 | Class: `KKW00127SF07DBean` | `KKW00127SF07DBean.removeElementFromListData` (override at L592) | (inherited base — no external caller) |
| 6 | Class: `KKW00127SF12DBean` | `KKW00127SF12DBean.removeElementFromListData` (override at L1000) | (inherited base — no external caller) |
| 7 | Class: `KKW00127SF22DBean` | `KKW00127SF22DBean.removeElementFromListData` (override at L475) | (inherited base — no external caller) |

**Cross-module subclasses (also override via `super`):**

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 8 | Class: `FUW00901SFBean` | `FUW00901SFBean.removeElementFromListData` -> `super.removeElementFromListData(key, index)` (L471) | (inherited base — no external caller) |
| 9 | Class: `FUW00907SFBean` | `FUW00907SFBean.removeElementFromListData` -> `super.removeElementFromListData(key, index)` (L863) | (inherited base — no external caller) |
| 10 | Class: `FUW00917SFBean` | `FUW00917SFBean.removeElementFromListData` -> `super.removeElementFromListData(key, index)` (L9242) | (inherited base — no external caller) |
| 11 | Class: `FUW00919SFBean` | `FUW00919SFBean.removeElementFromListData` -> `super.removeElementFromListData(key, index)` (L4401) | (inherited base — no external caller) |
| 12 | Class: `FUW00926SFBean` | `FUW00926SFBean.removeElementFromListData` -> `super.removeElementFromListData(key, index)` (L6224) | (inherited base — no external caller) |
| 13 | Class: `FUW00927SFBean` | `FUW00927SFBean.removeElementFromListData` -> `super.removeElementFromListData(key, index)` (L4907) | (inherited base — no external caller) |
| 14 | Class: `FUW00931SFBean` | `FUW00931SFBean.removeElementFromListData` -> `super.removeElementFromListData(key, index)` (L663) | (inherited base — no external caller) |
| 15 | Class: `FUW00957SFBean` | `FUW00957SFBean.removeElementFromListData` -> `super.removeElementFromListData(key, index)` (L1078) | (inherited base — no external caller) |

## 6. Per-Branch Detail Blocks

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

> Null guard: if `key` is null, return immediately (no-op). All subsequent processing is skipped.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key != null)` // Null guard on the list key parameter |
| 2 | EXEC | *(continue to Block 2 if true, return if false)* |

**Block 2** — IF-ELSE-IF-ELSE `(key.equals("サービス契約ステータスリスト"))` (L954)

> Branch on the string key for the Service Contract Status List. The Japanese key `"サービス契約ステータスリスト"` translates to "Service Contract Status List" (item ID: `svc_kei_stat_lis`). This list tracks the status of service contract line items (e.g., pending, active, cancelled).

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key.equals("サービス契約ステータスリスト"))` // Check if key matches Service Contract Status List [-> "サービス契約ステータスリスト" = "Service Contract Status List"] |
| 2 | EXEC | *(continue to Block 3 if true, check next key if false)* |

**Block 3** — IF `(index >= 0 && index < svc_kei_stat_lis_list.size())` (L955)

> Bounds check: verify the index falls within the current size of the service contract status list. If valid, remove the element. This prevents `IndexOutOfBoundsException` at runtime.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (index >= 0 && index < svc_kei_stat_lis_list.size())` // Check index is within the range of the current list size |
| 2 | EXEC | `svc_kei_stat_lis_list.remove(index)` // Remove the element at the specified index [-> "指定のインデックスが現在のリストの範囲内なら、そのインデックスの内容を削除" = "If the specified index is within the current list range, remove the content at that index"] |

**Block 4** — ELSE-IF `(key.equals("紹介コードリスト"))` (L960)

> Branch on the string key for the Introduction Code List. The Japanese key `"紹介コードリスト"` translates to "Introduction Code List" (item ID: `intr_cd_list`). This list holds referral/introduction codes linked to the service contract screen.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("紹介コードリスト"))` // Check if key matches Introduction Code List [-> "紹介コードリスト" = "Introduction Code List"] |
| 2 | EXEC | *(continue to Block 5 if true, fall through to end if false)* |

**Block 5** — IF `(index >= 0 && index < intr_cd_list_list.size())` (L961)

> Bounds check: verify the index falls within the current size of the introduction code list. If valid, remove the element.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (index >= 0 && index < intr_cd_list_list.size())` // Check index is within the range of the current list size |
| 2 | EXEC | `intr_cd_list_list.remove(index)` // Remove the element at the specified index [-> "指定のインデックスが現在のリストの範囲内なら、そのインデックスの内容を削除" = "If the specified index is within the current list range, remove the content at that index"] |

**Block 6** — RETURN (implicit) (L965)

> The method ends. No explicit return value (void). If `key` did not match any known list name or the index was out of bounds, the method simply returns without modifying any state.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // Implicit return (void method) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_stat_lis_list` | Field | Service Contract Status List — an `X33VDataTypeList` holding status entries for service contract line items on the screen |
| `intr_cd_list_list` | Field | Introduction Code List — an `X33VDataTypeList` holding referral/introduction code entries associated with the screen |
| `svc_kei_stat_lis` | Field | Service Contract Status List Item ID — the internal identifier for the service contract status list collection |
| `intr_cd_list` | Field | Introduction Code List Item ID — the internal identifier for the introduction code list collection |
| "サービス契約ステータスリスト" | Japanese key | Service Contract Status List — the human-readable key string used to identify the service contract status list target |
| "紹介コードリスト" | Japanese key | Introduction Code List — the human-readable key string used to identify the introduction code list target |
| X33VDataTypeList | Type | A typed list bean from the Fujitsu Futurity X33 web framework, wrapping `List` objects with data type metadata for JSF rendering |
| KKW00127SF | Module | Screen module code — the telecom service contract/operation screen module within the eo web platform |
| X33SException | Type | Exception class from the Fujitsu Futurity X33 framework, used for screen-level error handling |
