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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW07101SF.FUW07101SF02DBean` |
| Layer | Utility / Data Bean (Front-end DBean layer) |
| Module | `FUW07101SF` (Package: `eo.web.webview.FUW07101SF`) |

## 1. Role

### FUW07101SF02DBean.removeElementFromListData()

This method provides a generic list-element deletion utility for the FUW07101SF screen's data-binding infrastructure. It is invoked by UI-driven operations where a user removes an item from a dynamically-built list — specifically, either the "Application Target Name List" (申請対象名リスト) or the "Application Target Value List" (申請対象値リスト). These two parallel `X33VDataTypeList` structures hold label/value pairs used by the screen to render and manage multi-line selection or input controls. The method implements a **dispatch pattern**: based on the string key identifying which logical list to modify, it routes to the appropriate internal list and performs a bounds-checked removal via `List.remove(int)`. This method serves as a shared utility callable from any DBean subclass within the same module hierarchy (many `FUW009*SF` and `FUW07101SF` DBean classes override or delegate to this method via `super()`). It performs **no** database operations, service calls, or external I/O — it is a pure in-memory data manipulation routine.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["removeElementFromListData(key, index)"])
    CHECK_NULL{"key != null"}

    START --> CHECK_NULL
    CHECK_NULL -->|true| CHECK_KEY1{"key equals<br/>'申請対象名リスト'"}
    CHECK_NULL -->|false| END_NODE(["Return"])
    CHECK_KEY1 -->|true| CHECK_BOUNDS1{"index >= 0 AND<br/>index < nm_list_list.size()"}
    CHECK_KEY1 -->|false| CHECK_KEY2{"key equals<br/>'申請対象値リスト'"}
    CHECK_BOUNDS1 -->|true| REMOVE1["nm_list_list.remove(index)"]
    CHECK_BOUNDS1 -->|false| END_NODE
    CHECK_KEY2 -->|true| CHECK_BOUNDS2{"index >= 0 AND<br/>index < val_list_list.size()"}
    CHECK_KEY2 -->|false| END_NODE
    CHECK_BOUNDS2 -->|true| REMOVE2["val_list_list.remove(index)"]
    CHECK_BOUNDS2 -->|false| END_NODE
    REMOVE1 --> END_NODE
    REMOVE2 --> END_NODE
```

The method follows a three-tier dispatch flow:

1. **Null guard** — If `key` is null, the method returns immediately without performing any operation, protecting against null-pointer exceptions in downstream processing.
2. **Key dispatch** — The method checks which logical list the caller is targeting:
   - **`'申請対象名リスト'`** ("Application Target Name List") → delegates to `nm_list_list` (the name/label list).
   - **`'申請対象値リスト'`** ("Application Target Value List") → delegates to `val_list_list` (the value list).
3. **Bounds check + removal** — For the matched list, if the `index` is within valid range (`>= 0` and `< size()`), the element at that position is removed. If out of bounds, the method silently does nothing, preserving list integrity.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | Identifies which logical list to remove from. Valid values: `'申請対象名リスト'` (the display name/label list shown to the user in the UI) or `'申請対象値リスト'` (the corresponding raw value list). If `null`, no operation is performed. |
| 2 | `index` | `int` | Zero-based position of the element to delete within the target list. Must satisfy `0 <= index < list.size()`. Out-of-range values are silently ignored to prevent `IndexOutOfBoundsException`. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `nm_list_list` | `X33VDataTypeList` | List of display names/labels for application targets (申請対象名). Each element holds a `X33VDataTypeStringBean` wrapping the human-readable name string. |
| `val_list_list` | `X33VDataTypeList` | List of raw values for application targets (申請対象値). Each element holds a `X33VDataTypeStringBean` wrapping the corresponding value string. |

## 4. CRUD Operations / Called Services

This method performs **no** database operations, service component calls, or CBS invocations. All processing occurs in-memory on the `X33VDataTypeList` collections.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| D | `nm_list_list.remove(index)` | N/A (in-memory) | `nm_list_list` (X33VDataTypeList) | Removes the element at position `index` from the name list (申請対象名リスト) |
| D | `val_list_list.remove(index)` | N/A (in-memory) | `val_list_list` (X33VDataTypeList) | Removes the element at position `index` from the value list (申請対象値リスト) |

Both are **in-memory Delete operations** on Java collections — no database round-trip, no transaction, no persistence layer involvement.

## 5. Dependency Trace

This method is part of a common base-class pattern used across many DBean classes in the koptWebF and koptWebR front-end layers. It is defined in `FUW07101SF02DBean` and inherited/overridden by subclasses that delegate back via `super()`.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:DBean `FUW07101SFBean` | `FUW07101SFBean.removeElementFromListData` -> `super.removeElementFromListData` | `nm_list_list.remove(index) [D in-memory]` / `val_list_list.remove(index) [D in-memory]` |
| 2 | Screen:DBean `FUW07101SF09DBean` | `FUW07101SF09DBean.removeElementFromListData` | `nm_list_list.remove(index) [D in-memory]` / `val_list_list.remove(index) [D in-memory]` |
| 3 | Screen:DBean `FUW07101SF11DBean` | `FUW07101SF11DBean.removeElementFromListData` | `nm_list_list.remove(index) [D in-memory]` / `val_list_list.remove(index) [D in-memory]` |
| 4 | Screen:DBean `FUW07101SF17DBean` | `FUW07101SF17DBean.removeElementFromListData` | `nm_list_list.remove(index) [D in-memory]` / `val_list_list.remove(index) [D in-memory]` |
| 5 | Screen:DBean `FUW00912SF01DBean` | `FUW00912SF01DBean.removeElementFromListData` | `nm_list_list.remove(index) [D in-memory]` / `val_list_list.remove(index) [D in-memory]` |
| 6 | Screen:DBean `FUW00912SFBean` | `FUW00912SFBean.removeElementFromListData` -> `super.removeElementFromListData` | `nm_list_list.remove(index) [D in-memory]` / `val_list_list.remove(index) [D in-memory]` |
| 7 | Screen:DBean `FUW00926SFBean` | `FUW00926SFBean.removeElementFromListData` -> `super.removeElementFromListData` | `nm_list_list.remove(index) [D in-memory]` / `val_list_list.remove(index) [D in-memory]` |
| 8 | Screen:DBean `FUW00959SFBean` | `FUW00959SFBean.removeElementFromListData` -> `super.removeElementFromListData` | `nm_list_list.remove(index) [D in-memory]` / `val_list_list.remove(index) [D in-memory]` |

**Note:** This method appears in 100+ DBean classes across the codebase (FUW009*SF, FUW07101SF, CommonInfoCF*DBean, FUW09902SF, KKW02516SF, etc.). Most subclasses either delegate to `super()` (inheriting this implementation) or define their own specialized version. It is a framework-level utility method embedded within the DBean inheritance hierarchy, called by screen controllers when processing list-item removal actions.

## 6. Per-Branch Detail Blocks

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

> Null guard: if `key` is null, skip all processing and return immediately.

| # | Type | Code |
|---|------|------|
| 1 | SET | `// no assignment — guard condition only` |
| 2 | RETURN | `// implicit void return if key == null` |

---

**Block 2** — [IF-ELSE IF] `key.equals("申請対象名リスト")` ("Application Target Name List") (L461)

> Dispatches to the name list. When the key matches the Japanese string `'申請対象名リスト'`, the method operates on `nm_list_list`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `// key == '申請対象名リスト' — identifies nm_list_list` |
| 2 | EXEC | `// proceeds to bounds check and removal` |

---

**Block 2.1** — [IF] `index >= 0 && index < nm_list_list.size()` (L462)

> Bounds check: only removes if the index is within the current list size. If the index is out of range, silently skips — no exception thrown.

| # | Type | Code |
|---|------|------|
| 1 | SET | `// condition: index >= 0 AND index < nm_list_list.size()` |
| 2 | EXEC | `nm_list_list.remove(index);` // Delete element at specified index from nm_list_list (リスト項目のインスタンスを削除します) |

**Branches:**
- **True**: Element removed via `List.remove(int)` → element shifts left, list shrinks by 1.
- **False**: No-op; element preserved, method continues to next else-if.

---

**Block 3** — [ELSE IF] `key.equals("申請対象値リスト")` ("Application Target Value List") (L468)

> Dispatches to the value list. When the key matches the Japanese string `'申請対象値リスト'`, the method operates on `val_list_list`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `// key == '申請対象値リスト' — identifies val_list_list` |
| 2 | EXEC | `// proceeds to bounds check and removal` |

---

**Block 3.1** — [IF] `index >= 0 && index < val_list_list.size()` (L469)

> Bounds check: only removes if the index is within the current list size. If the index is out of range, silently skips — no exception thrown.

| # | Type | Code |
|---|------|------|
| 1 | SET | `// condition: index >= 0 AND index < val_list_list.size()` |
| 2 | EXEC | `val_list_list.remove(index);` // Delete element at specified index from val_list_list (リスト項目のインスタンスを削除します) |

**Branches:**
- **True**: Element removed via `List.remove(int)` → element shifts left, list shrinks by 1.
- **False**: No-op; element preserved, method continues.

---

**Block 4** — [IMPLICIT ELSE] key is null or unrecognized (L474)

> When `key` is null OR does not match either known list identifier, the method falls through and returns void without performing any modification. This is a safety net that silently ignores invalid requests.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `// void return — no-op for null or unrecognized key` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `nm_list_list` | Field | Name list — internal collection holding display name/label strings for application targets (申請対象名). Each element is a `X33VDataTypeStringBean` containing a human-readable label. |
| `val_list_list` | Field | Value list — internal collection holding raw value strings for application targets (申請対象値). Mirrors `nm_list_list` element-by-element; the value at index N corresponds to the name at index N. |
| `申請対象名リスト` | Japanese constant | "Application Target Name List" — the dispatch key identifying the name display list. Used by the UI to determine which column/field to remove an item from. |
| `申請対象値リスト` | Japanese constant | "Application Target Value List" — the dispatch key identifying the value data list. The parallel counterpart to the name list. |
| `X33VDataTypeList` | Technical type | X33 framework generic typed list container. A parameterized collection holding `X33VDataTypeBeanInterface` objects (here, `X33VDataTypeStringBean` instances). Part of the Fujitsu Futurity X33 web framework's data-binding layer. |
| `X33SException` | Technical type | X33 framework checked exception type. This method declares `throws X33SException` in its signature, though no code path currently throws it — the declaration is preserved for future extensibility. |
| DBean | Architectural term | Data Bean — front-end view-layer class that holds and transforms screen state between the JSF view and the business logic layer. Part of the X33 MVC pattern. |
| DBean subclass delegation | Pattern | Subclass DBeans call `super.removeElementFromListData(key, index)` to inherit base-class behavior, allowing shared list management without code duplication. |
| `select_cd_update` | Field | Selection code update flag — controls whether a selection change should trigger an update. Not read by this method. |
| `select_cd_value` | Field | Currently selected code value — the value of the most recently selected dropdown/radio item. Not read by this method. |
| `select_cd_state` | Field | Selection code state — tracks the state of the selection code field. Not read by this method. |
| `index` | Field | Default index position (int). Used by other methods in this class; not read by this method. |
