# Business Logic — DKW00301SF05DBean.removeElementFromListData() [13 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.DKW00301SF.DKW00301SF05DBean` |
| Layer | View Bean (Web View / UI Data Binding Layer) |
| Module | `DKW00301SF` (Package: `eo.web.webview.DKW00301SF`) |

## 1. Role

### DKW00301SF05DBean.removeElementFromListData()

This method provides UI-side list data management for the DKW00301SF screen family within the X33 view-based framework. Its purpose is to remove a single list item instance from an internal data list based on a typed key and an integer index. Specifically, it targets the **Equipment Provider Code Name List** (`kiki_teikyo_cd_list_list`) — the list that holds the available equipment provider (vendor) codes offered by K-Opticom for telecom service contracts. The method implements a **guarded removal pattern**: it first validates that the provided key is non-null, then dispatches to the appropriate list based on the key's business type, and only proceeds with removal if the index falls within the current list bounds. This is a **shared utility pattern** — the method is defined in a DBean (Detail Bean) that is overridden by the parent `DKW00301SFBean`, which itself consolidates removal logic for multiple typed lists across several screen variants (DKW00301SF02, SF03, SF01, SF04, etc.). The method plays a supporting role in dynamic form behavior: when users remove a selection row from a repeat section or multi-select list on the DKW00301SF screen, this method ensures the server-side view model stays in sync with the user's action.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["removeElementFromListData(key, index)"])

    START --> CHECK_KEY["Check: key != null"]

    CHECK_KEY -->|true| CHECK_LIST["Check: key equals '機器提供コード名称リスト' (Equipment Provider Code Name List)"]

    CHECK_LIST -->|true| CHECK_INDEX["Check: index >= 0 AND index < kiki_teikyo_cd_list_list.size()"]

    CHECK_INDEX -->|true| REMOVE["Remove element at index from kiki_teikyo_cd_list_list"]

    CHECK_LIST -->|false| END_METHOD(["Return / End (no-op)"])

    CHECK_INDEX -->|false| END_METHOD

    CHECK_KEY -->|false| END_METHOD
```

**Processing Description:**

1. **Null Guard:** The method first checks whether the `key` parameter is non-null. If `key` is `null`, the method returns immediately without performing any operation — this prevents NullPointerException on downstream `equals()` calls.

2. **Key Dispatch (Type Check):** If the key passes the null guard, it compares the key against the hardcoded string `"機器提供コード名称リスト"` (Equipment Provider Code Name List). This string is the business-type identifier for the equipment provider code list. Currently, this is the **only** key value handled by this DBean implementation. The parent `DKW00301SFBean` handles additional keys (such as `返品抽出条件` / Return Extraction Criteria, and a separate path for common info view lists starting with `//`), but `DKW00301SF05DBean` specializes only the equipment provider code list case.

3. **Index Bounds Validation:** When the key matches, the method validates that the `index` parameter is within the valid range: `index >= 0` AND `index < kiki_teikyo_cd_list_list.size()`. This prevents `IndexOutOfBoundsException` from being thrown by the underlying list's `remove()` method.

4. **Element Removal:** If the index is valid, the method calls `kiki_teikyo_cd_list_list.remove(index)` to remove the element at the specified position. This is a **D** (Delete) operation at the view-data level — it mutates the in-memory list that backs the UI component.

5. **No-Op Exit:** If any guard condition fails (key is null, key does not match, or index is out of bounds), the method returns silently with no side effects.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business-type identifier that determines which internal list to modify. For this DBean, it must be `"機器提供コード名称リスト"` (Equipment Provider Code Name List) to trigger removal from the equipment provider code list. If `null`, the method performs no operation. |
| 2 | `index` | `int` | The zero-based position of the element to remove within the target list. Must be within `[0, size)` of the list at call time. If out of bounds, the removal is skipped (no exception thrown). |

**Instance Fields / External State Read:**

| Field | Type | Business Meaning |
|-------|------|-----------------|
| `kiki_teikyo_cd_list_list` | `X33VDataTypeList` | The in-memory list holding Equipment Provider Code Name entries. Each element is an `X33VDataTypeBeanInterface` wrapping a value extracted via the key `"機器提供コード名称リスト"` / `"value"`. This list is initialized in the DBean constructor and populated by the screen's load/refresh logic. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| D | `kiki_teikyo_cd_list_list.remove(int)` | N/A (View Bean) | N/A (In-memory data) | Removes the element at the specified index from the equipment provider code name list — a client-side data mutation with no database impact. |

**Note:** This method performs **no** SC (Service Component), CBS (Business Component Service), or database operations. It operates exclusively on an in-memory `X33VDataTypeList` instance. The `remove(int)` call is a standard Java `List.remove()` invocation on a list held by the view bean, making this a pure view-state manipulation with zero persistence side effects.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | N/A (no external callers found) | — | — |
| 2 | — | (This method is inherited via `super.removeElementFromListData()` from `DKW00301SFBean`) | — |

**Notes on Dependency Trace:**
- No external callers were found that invoke `removeElementFromListData` on `DKW00301SF05DBean` instances directly.
- This method is a **specialized override** of the parent class (`DKW00301SFBean`) implementation. The parent `DKW00301SFBean.removeElementFromListData` dispatches to multiple typed lists (common info view lists starting with `//`, return extraction criteria for DKW00301SF02, and delegates to `super` for handling in the base class). `DKW00301SF05DBean` adds the equipment provider code name list as an additional branch.
- The method is likely called indirectly via polymorphism when screen processing code invokes `removeElementFromListData` on a `DKW00301SFBean` reference that is actually an instance of `DKW00301SF05DBean`.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key != null)` (L3647)

> Guard clause: skip processing if key is null to prevent NullPointerException.

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (key != null)` // Null guard — proceed only if key is non-null [L3647] |
| 2 | EXEC | (enter guarded block — continue to key dispatch) |

---

**Block 2** — [IF] `(key.equals("機器提供コード名称リスト"))` [L3650]

> Type dispatch: this hardcoded string is the business-type identifier for the Equipment Provider Code Name List. If the key matches, removal proceeds on `kiki_teikyo_cd_list_list`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (key.equals("機器提供コード名称リスト"))` // Key equals "Equipment Provider Code Name List" [-> STRING_LITERAL] [L3650] |
| 2 | EXEC | (enter matching branch — proceed to index validation) |

---

**Block 3** — [IF] `(index >= 0 && index < kiki_teikyo_cd_list_list.size())` [L3652]

> Bounds check: validates that the index is within the current list range before attempting removal. Prevents `IndexOutOfBoundsException`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (index >= 0 && index < kiki_teikyo_cd_list_list.size())` // Index must be non-negative and less than list size [L3652] |
| 2 | EXEC | `kiki_teikyo_cd_list_list.remove(index);` // Remove element at index from equipment provider code name list [D: view-data mutation] [L3653] |

---

**Block 4** — [ELSE - implicit fall-through / no-ops]

> When any guard condition fails, the method returns without performing any operation:
> - Block 1: `key == null` → return immediately
> - Block 2: key does not match `"機器提供コード名称リスト"` → return immediately
> - Block 3: index out of bounds → return immediately (no element removed)

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|-----------------|
| `kiki_teikyo_cd_list_list` | Field | Equipment Provider Code Name List — in-memory list holding available equipment/vendor codes for telecom service selection on the DKW00301SF screen |
| `機器提供コード名称リスト` | Field | Equipment Provider Code Name List — Japanese business label used as the key to identify this list type |
| DBean | Acronym | Detail Bean — a view bean class (extending `X33VViewBaseBean`) that holds screen-level data state and provides getter/setter methods for UI binding |
| X33 | Acronym | Fujitsu's X33 Web Application Framework — the UI framework this project is built on |
| `X33VDataTypeList` | Type | A typed list container from the X33 framework that holds `X33VDataTypeBeanInterface` objects for structured data binding to JSF UI components |
| X33VViewBaseBean | Class | Base class for view beans in the X33 framework — provides common view-layer functionality including list management methods like `removeElementFromListData` |
| X33SException | Type | X33 Framework exception type thrown by view bean methods on processing errors |
| DKW00301SF | Module | Screen module identifier — the DKW00301SF screen family in the K-Opticom telecom service management system |
| `kiki_teikyo` | Field Prefix | Equipment Provider — refers to equipment/vendor codes in the telecom service catalog |
