---
title: "Business Logic — KKW00401SF02DBean.removeElementFromListData() [41 LOC]"
---

# Business Logic — KKW00401SF02DBean.removeElementFromListData() [41 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00401SF.KKW00401SF02DBean` |
| Layer | Data Bean / View Component (Web view data transfer object in the X33 framework) |
| Module | `KKW00401SF` (Package: `eo.web.webview.KKW00401SF`) |

## 1. Role

### KKW00401SF02DBean.removeElementFromListData()

This method provides dynamic list-item removal for data-type view beans in the K-Opticom web application framework, specifically within the STB (Set-Top Box) change registration screen (KKW00401SF). It is a shared utility method that serves as the counterpart to `addListDataInstance()` — while the add method creates new empty bean instances and appends them to a typed list, this removal method deletes an existing instance at a specified index from a targeted list. The method implements a **discriminated dispatch pattern**: based on the `key` parameter, which represents a business item identifier (the human-readable Japanese label for the data type), it routes to the correct internal `X33VDataTypeList` and removes the element at the given `index`. Five distinct data type branches are supported: STB migration classification (STB異動区分), selected model number (選択型番号), STB classification (STB区分), HDD capacity (HDD容量), and TV course (TVコース). Each branch enforces bounds checking to prevent `IndexOutOfBoundsException` — if the index falls outside the valid range `[0, list.size())`, the removal is silently skipped (no-op). The method plays a central role in the dynamic list UI pattern where users can add and remove STB configuration line items on the web screen; when a user removes a row from a table, the screen controller delegates to this method to keep the model in sync with the view state. It has no external side effects (no DB calls, no SC invocations) and operates purely on in-memory data structures.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["removeElementFromListData(key, index)"])
    CHECK_KEY_NULL{"key != null?"}
    CHECK_STB_IDO{"key == STB異動区分?"}
    CHECK_SEL_TYPE{"key == 選択型番号?"}
    CHECK_STB_DIV{"key == STB区分?"}
    CHECK_HDD_CAPA{"key == HDD容量?"}
    CHECK_TV_COURSE{"key == TVコース?"}

    STB_IDO_BOUNDS{"index in range?"}
    SEL_TYPE_BOUNDS{"index in range?"}
    STB_DIV_BOUNDS{"index in range?"}
    HDD_CAPA_BOUNDS{"index in range?"}
    TV_COURSE_BOUNDS{"index in range?"}

    STB_IDO_REMOVE["stb_ido_div_list.remove(index)"]
    SEL_TYPE_REMOVE["sel_type_number_list.remove(index)"]
    STB_DIV_REMOVE["stb_div_list.remove(index)"]
    HDD_CAPA_REMOVE["hdd_capa_list.remove(index)"]
    TV_COURSE_REMOVE["tv_course_list.remove(index)"]

    END_NODE(["Return / Next"])

    START --> CHECK_KEY_NULL
    CHECK_KEY_NULL -->|Yes| CHECK_STB_IDO
    CHECK_KEY_NULL -->|No| END_NODE

    CHECK_STB_IDO -->|Yes| STB_IDO_BOUNDS
    CHECK_STB_IDO -->|No| CHECK_SEL_TYPE

    CHECK_SEL_TYPE -->|Yes| SEL_TYPE_BOUNDS
    CHECK_SEL_TYPE -->|No| CHECK_STB_DIV

    CHECK_STB_DIV -->|Yes| STB_DIV_BOUNDS
    CHECK_STB_DIV -->|No| CHECK_HDD_CAPA

    CHECK_HDD_CAPA -->|Yes| HDD_CAPA_BOUNDS
    CHECK_HDD_CAPA -->|No| CHECK_TV_COURSE

    CHECK_TV_COURSE -->|Yes| TV_COURSE_BOUNDS
    CHECK_TV_COURSE -->|No| END_NODE

    STB_IDO_BOUNDS -->|Yes| STB_IDO_REMOVE
    STB_IDO_BOUNDS -->|No| END_NODE

    SEL_TYPE_BOUNDS -->|Yes| SEL_TYPE_REMOVE
    SEL_TYPE_BOUNDS -->|No| END_NODE

    STB_DIV_BOUNDS -->|Yes| STB_DIV_REMOVE
    STB_DIV_BOUNDS -->|No| END_NODE

    HDD_CAPA_BOUNDS -->|Yes| HDD_CAPA_REMOVE
    HDD_CAPA_BOUNDS -->|No| END_NODE

    TV_COURSE_BOUNDS -->|Yes| TV_COURSE_REMOVE
    TV_COURSE_BOUNDS -->|No| END_NODE

    STB_IDO_REMOVE --> END_NODE
    SEL_TYPE_REMOVE --> END_NODE
    STB_DIV_REMOVE --> END_NODE
    HDD_CAPA_REMOVE --> END_NODE
    TV_COURSE_REMOVE --> END_NODE
```

**Branch Summary:**

| Branch | Key Value (Japanese) | English Meaning | Target List |
|--------|---------------------|-----------------|-------------|
| 1 | `STB異動区分` | STB Migration Classification | `stb_ido_div_list` |
| 2 | `選択型番号` | Selected Model Number | `sel_type_number_list` |
| 3 | `STB区分` | STB Classification | `stb_div_list` |
| 4 | `HDD容量` | HDD Capacity | `hdd_capa_list` |
| 5 | `TVコース` | TV Course | `tv_course_list` |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The item identifier for a data-type view bean. It carries the human-readable Japanese label that identifies which list the caller wants to remove an element from. Valid values map one-to-one to five STB (Set-Top Box) configuration data categories used in the change registration screen: "STB異動区分" (STB migration classification), "選択型番号" (selected model number), "STB区分" (STB classification), "HDD容量" (HDD capacity), and "TVコース" (TV course). Passing `null` causes the method to exit early (no-op). |
| 2 | `index` | `int` | The 0-based position of the element to remove within the targeted list. Used in conjunction with `key` to locate the specific item to delete. If the index is out of bounds (negative or >= list size), the removal is silently skipped — no exception is thrown. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `stb_ido_div_list` | `X33VDataTypeList` | List holding STB migration classification items (e.g., "new connection", "replacement", "upgrade") |
| `sel_type_number_list` | `X33VDataTypeList` | List holding selected model number items |
| `stb_div_list` | `X33VDataTypeList` | List holding STB classification items |
| `hdd_capa_list` | `X33VDataTypeList` | List holding HDD capacity items |
| `tv_course_list` | `X33VDataTypeList` | List holding TV course items |

## 4. CRUD Operations / Called Services

This method performs **pure in-memory list manipulation only**. It does not invoke any Service Components (SC), CallBack Services (CBS), or database operations. All five branches call `java.util.List.remove(int)` on local `X33VDataTypeList` instances, which is a client-side state modification — not a database CRUD operation.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| *(none)* | *(none)* | *(none)* | *(none)* | *(none)* — This method operates exclusively on in-memory lists (`X33VDataTypeList`) and performs no external service calls or database operations. The removed elements become unreachable in the Java heap but are not persisted or deleted from any database table. |

## 5. Dependency Trace

### Who calls this method

This method is defined as `public` on `KKW00401SF02DBean` and is called via `super.removeElementFromListData(key, index)` by subclasses that override the base implementation. Within the KKW00401SF module, `KKW00401SFBean` extends `KKW00401SF02DBean` and overrides `removeElementFromListData`, delegating to `super.removeElementFromListData(key, index)` (line 27404).

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW00401SF (KKW00401SFBean) | `KKW00401SFBean.removeElementFromListData(key, index)` -> `super.removeElementFromListData(key, index)` (KKW00401SF02DBean) | *(none — in-memory only)* |

### What this method calls

| # | Called Method | Description |
|---|--------------|-------------|
| 1 | `X33VDataTypeList.remove(int)` | Java list removal — deletes element at given index from the targeted list |

## 6. Per-Branch Detail Blocks

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

> Null guard: if `key` is null, the entire method exits early without any operation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (key != null)` // null check guard — if null, skip entire method body |

---

**Block 2** — [IF] `key.equals("STB異動区分")` — STB Migration Classification (L4048)

> When `key` matches "STB異動区分" (STB migration classification), the method targets the `stb_ido_div_list` for removal. This list holds STB migration type items (e.g., new connection, replacement, upgrade).

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (key.equals("STB異動区分"))` // Check if targeting STB migration classification list |

---

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

> Bounds validation: the specified index must be within the current list range `[0, stb_ido_div_list.size())`. The Japanese comment states: "If the specified index is within the current list range, remove the content at that index."

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (index >= 0 && index < stb_ido_div_list.size())` // bounds check: index must be >= 0 and < list size |
| 2 | EXEC | `stb_ido_div_list.remove(index)` // Remove element at index from STB migration classification list |

---

**Block 3** — [ELSE-IF] `key.equals("選択型番号")` — Selected Model Number (L4054)

> When `key` matches "選択型番号" (selected model number), the method targets the `sel_type_number_list`. This list holds model number selections for STB configurations.

| # | Type | Code |
|---|------|------|
| 1 | SET | `else if (key.equals("選択型番号"))` // Check if targeting selected model number list |

---

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

> Bounds validation for the selected model number list. Same range check pattern as Block 2.1.

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (index >= 0 && index < sel_type_number_list.size())` // bounds check |
| 2 | EXEC | `sel_type_number_list.remove(index)` // Remove element at index from selected model number list |

---

**Block 4** — [ELSE-IF] `key.equals("STB区分")` — STB Classification (L4060)

> When `key` matches "STB区分" (STB classification), the method targets the `stb_div_list`. This list holds STB type/category classification items.

| # | Type | Code |
|---|------|------|
| 1 | SET | `else if (key.equals("STB区分"))` // Check if targeting STB classification list |

---

**Block 4.1** — [IF] `index >= 0 && index < stb_div_list.size()` (L4061)

> Bounds validation for the STB classification list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (index >= 0 && index < stb_div_list.size())` // bounds check |
| 2 | EXEC | `stb_div_list.remove(index)` // Remove element at index from STB classification list |

---

**Block 5** — [ELSE-IF] `key.equals("HDD容量")` — HDD Capacity (L4066)

> When `key` matches "HDD容量" (HDD capacity), the method targets the `hdd_capa_list`. This list holds HDD capacity specification items for STB configurations.

| # | Type | Code |
|---|------|------|
| 1 | SET | `else if (key.equals("HDD容量"))` // Check if targeting HDD capacity list |

---

**Block 5.1** — [IF] `index >= 0 && index < hdd_capa_list.size()` (L4067)

> Bounds validation for the HDD capacity list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (index >= 0 && index < hdd_capa_list.size())` // bounds check |
| 2 | EXEC | `hdd_capa_list.remove(index)` // Remove element at index from HDD capacity list |

---

**Block 6** — [ELSE-IF] `key.equals("TVコース")` — TV Course (L4072)

> When `key` matches "TVコース" (TV course), the method targets the `tv_course_list`. This list holds television course subscription items associated with STB configurations.

| # | Type | Code |
|---|------|------|
| 1 | SET | `else if (key.equals("TVコース"))` // Check if targeting TV course list |

---

**Block 6.1** — [IF] `index >= 0 && index < tv_course_list.size()` (L4073)

> Bounds validation for the TV course list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (index >= 0 && index < tv_course_list.size())` // bounds check |
| 2 | EXEC | `tv_course_list.remove(index)` // Remove element at index from TV course list |

---

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `STB` | Acronym | Set-Top Box — a set-top box device used for cable/satellite TV and broadband internet delivery |
| `STB異動区分` (stb_ido_div) | Field | STB Migration Classification — categorizes the type of STB change: new connection, replacement, upgrade, or other migration event |
| `STB区分` (stb_div) | Field | STB Classification — categorizes the STB device type or model category |
| `選択型番号` (sel_type_number) | Field | Selected Model Number — the specific model number of the STB selected by the user |
| `HDD容量` (hdd_capa) | Field | HDD Capacity — the storage capacity specification of the STB's built-in hard disk drive |
| `TVコース` (tv_course) | Field | TV Course — television subscription course/package associated with the STB configuration |
| `X33VDataTypeList` | Class | X33 framework dynamic data-type list — a framework-provided generic list container that holds instances of typed data beans (`X33VDataTypeBeanInterface` implementers) for dynamic table UIs |
| `KKW00401SF` | Module | STB change registration screen module — a web screen (KKW series) for registering/modifying STB (Set-Top Box) configuration changes |
| `KKW00401SF02DBean` | Class | Data bean for STB change registration screen — extends base bean and provides typed list management (add/remove) for dynamic table rows |
| `KKW00401SF01DBean` | Class | Base data bean — the individual row item class added to the typed lists (e.g., to `stb_ido_div_list`) |
| `X33SException` | Class | X33 framework application exception — the standard checked exception type for the X33 web framework |
| `X33VDataTypeBeanInterface` | Interface | X33 framework interface — marks a class as a data-type view bean that can be stored in an `X33VDataTypeList` |
| `X33VListedBeanInterface` | Interface | X33 framework interface — marks a class as a listed bean that manages dynamic data-type lists |
| K-Opticom | Business term | KDDI's fiber optic broadband brand — the telecom service provider this application serves |
| データタイプビーン (data-type bean) | Term | Data-type view bean — an X33 framework concept for beans that hold data entries in dynamic table lists, supporting add/remove operations at runtime |
| データタイプビーン型の項目 (data-type view bean item) | Term | A list item identifier that maps to a specific typed list within the bean |
| クラス名 (class name) | Term | Java class name used as a discriminator in the dispatch pattern |
