# Business Logic — Mover.getBooleanArray() [11 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW01021SF.Mover.getBooleanArray` |
| Layer | Utility (Mover classes are static helper classes within the webview layer) |
| Module | `KKW01021SF` (Package: `eo.web.webview.KKW01021SF`) |

## 1. Role

### Mover.getBooleanArray()

This method extracts a dynamically-sized array of Boolean values from a data bean, where the booleans are stored as indexed items under a common key prefix. The `item` parameter identifies the logical group of booleans, while `getArrayCount` is used first to determine how many booleans exist for that key. It iterates from index `0` through `count - 1`, calling `getBooleanAt` for each index to retrieve the individual Boolean value. The design follows a **delegation pattern**: rather than performing data extraction itself, it delegates counting and per-element access to sibling static methods in the same `Mover` class. It is a **shared utility** used by multiple screen-level classes (e.g., `KKW01021SFAction`, `KKW01021SA0101Action`, `KKW01021SA0201Action`, `KKW01021SA0202Action`) to convert indexed data bean entries into a native `Boolean[]` — a pattern essential for forms that render variable-size lists of checkboxes or toggle fields. In the larger system, this bridges the gap between the `X31SDataBeanAccess` data access abstraction (which uses string-keyed indexed storage) and Java-typed array consumers that need a concrete `Boolean[]` for iteration or binding.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getBooleanArray(bean, item)"])
    STEP1["Call getArrayCount(bean, item)"]
    STEP2["Create ArrayList result with count capacity"]
    LOOP_START{"i < count?"}
    STEP3["Call getBooleanAt(bean, item, i)"]
    STEP4["Add element to result"]
    LOOP_INC["Increment i"]
    STEP5["Return (Boolean)result.toArray(new Boolean[0])"]
    END_NODE(["Return Boolean[]"])

    START --> STEP1 --> STEP2 --> LOOP_START
    LOOP_START -- true --> STEP3 --> STEP4 --> LOOP_INC --> LOOP_START
    LOOP_START -- false --> STEP5 --> END_NODE
```

**Processing description:**

1. **Count resolution** — The method first calls `getArrayCount(bean, item)` to determine the number of indexed Boolean entries associated with `item` in the data bean. This establishes the loop bound.
2. **Collection allocation** — An `ArrayList<Boolean>` is created with the resolved count as its initial capacity, avoiding unnecessary reallocation.
3. **Indexed extraction loop** — For each index `i` from `0` to `count - 1`, the method calls `getBooleanAt(bean, item, i)` to retrieve the individual Boolean at that index, adding each to the result list.
4. **Array conversion and return** — After the loop completes, the `ArrayList` is converted to a `Boolean[]` via `toArray(new Boolean[0])` and returned.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `bean` | `X31SDataBeanAccess` | The screen data bean containing indexed Boolean data. This is the central data transfer object passed between the view layer and logic layer, holding form field values submitted from the UI (e.g., checkbox states, toggle flags). |
| 2 | `item` | `String` | The key prefix identifying which group of indexed Boolean values to extract. This corresponds to a UI field group (such as a row-indexed set of checkboxes) stored in the data bean under a common name. |

**External state / instance fields read:** None — this method is fully static and stateless.

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `Mover.getArrayCount` | - | - | Calls `getArrayCount` in `Mover` to determine how many indexed values exist for the given item key |
| R | `Mover.getBooleanAt` | - | - | Calls `getBooleanAt` in `Mover` to retrieve the Boolean value at each index |
| - | `ArrayList.toArray` | - | - | Converts the accumulated `ArrayList<Boolean>` into a `Boolean[]` |

**Classification:** This method performs **only read operations** — it extracts data from an in-memory data bean without creating, updating, or deleting any database records. The `getArrayCount` and `getBooleanAt` calls are data bean accessor methods that perform indexed reads on the `X31SDataBeanAccess` object.

## 5. Dependency Trace

### Pre-computed evidence from code analysis graph:

No screen/batch entry points found within 8 hops. Direct callers found: 22 methods.
Terminal operations from this method: `toArray` [-], `getBooleanAt` [R], `getArrayCount` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Action:KKW01021SFAction | `KKW01021SFAction.execute` -> `getBooleanArray` | `getBooleanAt [R] -`, `getArrayCount [R] -` |
| 2 | Action:KKW01021SA0101Action | `KKW01021SA0101Action.execute` -> `getBooleanArray` | `getBooleanAt [R] -`, `getArrayCount [R] -` |
| 3 | Action:KKW01021SA0201Action | `KKW01021SA0201Action.execute` -> `getBooleanArray` | `getBooleanAt [R] -`, `getArrayCount [R] -` |
| 4 | Action:KKW01021SA0202Action | `KKW01021SA0202Action.execute` -> `getBooleanArray` | `getBooleanAt [R] -`, `getArrayCount [R] -` |
| 5 | Mover:getBeanMapFromDataBean | `getBeanMapFromDataBean` -> `getBooleanArray` | `getBooleanAt [R] -`, `getArrayCount [R] -` |

**How to classify:** This method performs **only read operations** — it extracts data from an in-memory data bean without creating, updating, or deleting any database records.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `count = getArrayCount(bean, item)` (L1299)

> Initialize the loop count by querying the data bean for how many indexed entries exist under the given item key.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int count = getArrayCount(bean, item)` // Determines the number of indexed Booleans for this item key |

**Block 2** — [SET] `result = new ArrayList<Boolean>(count)` (L1300)

> Allocate a mutable list pre-sized to hold exactly `count` elements, avoiding array reallocation overhead.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList<Boolean> result = new ArrayList<Boolean>(count)` // Pre-sized list for indexed extraction |

**Block 3** — [FOR] `(int i = 0; i < count; i++)` (L1301)

> Iterate over each index to extract the individual Boolean value. This is the core extraction loop.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int i = 0` // Loop index, starts at zero |
| 2 | COND | `i < count` // Continue while index is within bounds |
| 3 | EXEC | `i++` // Post-iteration increment |

**Block 3.1** — [nested body] `getBooleanAt(bean, item, i)` (L1303)

> Retrieve the Boolean value stored at index `i` under the `item` key in the data bean.

| # | Type | Code |
|---|------|------|
| 1 | SET | `Boolean element = getBooleanAt(bean, item, i)` // Fetch indexed Boolean value |
| 2 | CALL | `result.add(element)` // Accumulate into the result list |

**Block 4** — [RETURN] (L1307)

> Convert the accumulated list to a native `Boolean[]` array and return it.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return (Boolean[]) result.toArray(new Boolean[0])` // ArrayList -> Boolean[] conversion |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `X31SDataBeanAccess` | Class | Screen data bean access class — the central data transfer object used between UI forms and business logic, providing keyed access to form field values including indexed (array-like) entries |
| `Mover` | Class | Static utility helper class within the webview layer that provides common data conversion and extraction methods (e.g., Boolean/Integer/String array conversions from data beans) |
| `getBooleanAt` | Method | Retrieves a single Boolean value at a specified index from an indexed data bean entry |
| `getArrayCount` | Method | Returns the number of indexed entries associated with a given key in a data bean |
| `Boolean[]` | Type | Java array of Boolean objects — the typed return format used for UI data binding or conditional logic in action classes |
| `ArrayList` | Class | Java mutable dynamic array used as an intermediate collection before conversion to a fixed-size array |
