---

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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00156SF.FUW00156SF02DBean` |
| Layer | Utility / Data Bean (Frameworl Component Layer) |
| Module | `FUW00156SF` (Package: `eo.web.webview.FUW00156SF`) |

## 1. Role

### FUW00156SF02DBean.removeElementFromListData()

This method provides a **framework-level utility operation** for removing a single element from a typed list managed by the X33 web framework's data bean layer. Specifically, it handles the deletion of an item from the **Survey Answer List** (`enquete_answer_list_list`), which holds `X33VDataTypeList` entries representing individual survey response records. The method follows a **guarded deletion pattern**: it validates the input key against the expected field name constant ("アンケート回答リスト", i.e., "Survey Answer List"), checks that the target index is within the current bounds of the list, and only then invokes the underlying `List.remove(index)` operation.

This is a **shared utility method** that serves as a base implementation across multiple DBean subclasses (e.g., `FUW00912SF01DBean`, `FUW00964SFBean`, `FUW00901SFBean`, etc.), which either override it for their own list operations or delegate to the parent via `super.removeElementFromListData()`. The method does **not** perform any database persistence — it operates purely on in-memory view state, meaning the removal is scoped to the current page/session and must be followed by a separate persistence operation (if permanence is required).

The method implements the **Delegation design pattern**, acting as a dispatcher that routes the removal request to the correct in-memory list based on the `key` parameter. It also enforces the **Fail-fast pattern** by validating the `key` for null and the `index` for bounds before attempting removal, silently skipping the operation if either check fails rather than throwing an exception.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["removeElementFromListData(String key, int index)"])
    CHECK_KEY_NOT_NULL{"key != null?"}
    CHECK_KEY_VALUE{"key equals 'アンケート回答リスト' (Survey Answer List)?"}
    CHECK_INDEX_BOUNDS{"index >= 0 AND index < enquete_answer_list_list.size() (list length)?"}
    REMOVE_ELEMENT["enquete_answer_list_list.remove(index)"]
    END_RETURN(["Return / Next"])

    START --> CHECK_KEY_NOT_NULL
    CHECK_KEY_NOT_NULL -->|Yes| CHECK_KEY_VALUE
    CHECK_KEY_NOT_NULL -->|No| END_RETURN
    CHECK_KEY_VALUE -->|Yes| CHECK_INDEX_BOUNDS
    CHECK_KEY_VALUE -->|No| END_RETURN
    CHECK_INDEX_BOUNDS -->|Yes| REMOVE_ELEMENT
    CHECK_INDEX_BOUNDS -->|No| END_RETURN
    REMOVE_ELEMENT --> END_RETURN
```

**CRITICAL — Constant Resolution:**

The method compares the `key` parameter against the hardcoded literal string `"アンケート回答リスト"`, which is **not** backed by a separate constant class. The business meaning is:

- **`"アンケート回答リスト"`** = "Survey Answer List" — the internal field name for the list of survey response entries in the FUW00156SF screen. This is a Japanese-literal constant, meaning the screen layer must pass this exact string to target this list.

The `index` is validated against `enquete_answer_list_list.size()`, which is the current runtime size of the list (no constant).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **field name identifier** for the list from which an element should be removed. In this method, the only supported value is `"アンケート回答リスト"` (Survey Answer List), which corresponds to the `enquete_answer_list_list` in-memory list holding survey response entries. If `null` or an unrecognized value is passed, the method performs a no-op. |
| 2 | `index` | `int` | The **zero-based positional index** of the survey answer entry to remove from the list. The method validates that the index falls within `[0, list.size()-1]`. If the index is out of bounds (negative or >= size), the method performs a no-op without throwing an exception. |

**Instance Fields / External State Read:**

| # | Field | Type | Business Description |
|---|-------|------|---------------------|
| 1 | `enquete_answer_list_list` | `X33VDataTypeList` | The in-memory list of survey answer entries. Each element is an `X33VDataTypeBeanInterface` wrapper containing a survey response. The list is initialized in the constructor as an empty list. |

## 4. CRUD Operations / Called Services

This method performs a **pure in-memory list operation** with no external service calls, SC codes, or database interactions.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U (In-Memory) | `List.remove(int)` | — | — (in-memory) | Removes the element at the specified zero-based index from the `enquete_answer_list_list` in-memory list. This is a view-state mutation only; no database persistence occurs. |

**Classification rationale:** The `List.remove(index)` call modifies the in-memory data structure, so it is classified as an **Update (U)** from the CRUD perspective. However, it does not persist to any database table — it operates entirely within the X33 framework's view data layer (`X33VDataTypeList`).

## 5. Dependency Trace

This method follows an **inheritance/delegation pattern**. It is defined as a base implementation in `FUW00156SF02DBean` and **inherited** by approximately 20+ DBean subclasses across the codebase. No direct callers were found within the `FUW00156SF` package, confirming its role as a reusable base utility rather than a screen-specific method.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: Inherited Base | Various DBeans override or call `super.removeElementFromListData()` | In-memory list removal (U) |
| 2 | Screen: FUW00912SF | `FUW00912SF01DBean.removeElementFromListData()` overrides base | In-memory list removal (U) |
| 3 | Screen: FUW00912SF | `FUW00912SFBean.removeElementFromListData()` → `super.removeElementFromListData()` | In-memory list removal (U) |
| 4 | Screen: FUW00926SF | `FUW00926SFBean.removeElementFromListData()` → `super.removeElementFromListData()` | In-memory list removal (U) |
| 5 | Screen: FUW00959SF | `FUW00959SFBean.removeElementFromListData()` → `super.removeElementFromListData()` | In-memory list removal (U) |
| 6 | Screen: FUW00964SF | `FUW00964SFBean.removeElementFromListData()` → `super.removeElementFromListData()` | In-memory list removal (U) |
| 7 | Screen: FUW00964SF | `FUW00964SF10DBean.removeElementFromListData()` overrides base | In-memory list removal (U) |
| 8 | Screen: FUW00964SF | `FUW00964SF04DBean.removeElementFromListData()` overrides base | In-memory list removal (U) |
| 9 | Screen: FUW00964SF | `FUW00964SF07DBean.removeElementFromListData()` overrides base | In-memory list removal (U) |
| 10 | Screen: FUW00964SF | `FUW00964SF01DBean.removeElementFromListData()` overrides base | In-memory list removal (U) |
| 11 | Screen: FUW00927SF | `FUW00927SFBean.removeElementFromListData()` → `super.removeElementFromListData()` | In-memory list removal (U) |
| 12 | Screen: FUW00901SF | `FUW00901SFBean.removeElementFromListData()` → `super.removeElementFromListData()` | In-memory list removal (U) |
| 13 | Screen: FUW00919SF | `FUW00919SFBean.removeElementFromListData()` → `super.removeElementFromListData()` | In-memory list removal (U) |
| 14 | Screen: FUW00931SF | `FUW00931SFBean.removeElementFromListData()` → `super.removeElementFromListData()` | In-memory list removal (U) |
| 15 | Screen: FUW00907SF | `FUW00907SFBean.removeElementFromListData()` → `super.removeElementFromListData()` | In-memory list removal (U) |

**Note:** The above table shows subclasses that either override the method with their own `key` logic or delegate to `super.removeElementFromListData(key, index)`. These DBeans manage different in-memory lists specific to their screen's domain. The base method in `FUW00156SF02DBean` handles only the **Survey Answer List** branch.

## 6. Per-Branch Detail Blocks

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

> Null guard: prevents NullPointerException if the caller passes a null key. If `key` is null, the method exits immediately without performing any operation.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key != null` // Null guard — skip if key is not provided |

**Block 2** — [IF-ELSE] `(key.equals("アンケート回答リスト"))` (L698)

> Key dispatch: compares the key against the literal string `"アンケート回答リスト"` (Survey Answer List). Only the "Survey Answer List" branch is implemented; all other keys fall through without action.
> This is effectively an **if-only** pattern (no else-branch) — unrecognized keys are silently ignored.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key.equals("アンケート回答リスト")` // Dispatch to Survey Answer List branch [Literal: "アンケート回答リスト" = Survey Answer List] |
| 2 | SET | (implicit — enters nested block on match) |

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

> Bounds check: validates that the requested index is within the valid range of the `enquete_answer_list_list`. The comment reads "指定のインデックスが現在のリストの範囲内なら、そのインデックスの内容を削除" (If the specified index is within the current list range, delete the content at that index). If the index is out of bounds, the method performs a no-op.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `index >= 0 && index < enquete_answer_list_list.size()` // Validates index is within [0, list.size()-1] |
| 2 | EXEC | `enquete_answer_list_list.remove(index);` // Removes the element at the given index from the in-memory list [Comment: 指定のインデックスが現在のリストの範囲内なら、そのインデックスの内容を削除] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `enquete_answer_list_list` | Field | Survey Answer List — an in-memory `X33VDataTypeList` holding individual survey response entries for the FUW00156SF screen. Each element is a typed data bean wrapping a survey answer value. |
| `アンケート回答リスト` | Field | Japanese literal meaning "Survey Answer List" — the hardcoded key used to identify the survey answer list in the DBean's list dispatch logic. |
| `X33VDataTypeList` | Technical | Fujitsu Futurity X33 framework's typed list data type — a generic container that holds `X33VDataTypeBeanInterface` objects, each wrapping a typed value (String, Boolean, Long, etc.). |
| `X33VDataTypeBeanInterface` | Technical | Interface for a single typed data element within an `X33VDataTypeList`. |
| `X33SException` | Technical | X33 framework exception class thrown by data bean methods for framework-level errors. |
| DBean | Acronym | Data Bean — a view-tier data holder class in the X33 framework that manages screen-level state, including form inputs, lists, and validation results. |
| FUW00156SF | Module | Survey/Enquiry (アンケート) screen module — the functional unit handling survey question presentation and answer collection. |
| enquete | Field | Japanese-origin term meaning "survey" or "questionnaire" — used throughout the codebase for survey-related entities and fields. |

---
