# maryoxd/algorithms-and-data-structures-linear-hashing architecture

> Architecture diagram of the GitHub repository maryoxd/algorithms-and-data-structures-linear-hashing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maryoxd/algorithms-and-data-structures-linear-hashing
- Repository: https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing

## Overview

This is a Swing desktop application for managing people and their PCR tests in persistent heap files backed by linear hashing. The main workflow runs from the user interface through AppController and Model, which validate and perform person/test operations, then display results and file-block views. The storage path uses linear hash files over heap files and serialized blocks; person and test records define the persisted data. The tree and excerpts support these key call paths, but do not expose every operation or UI route.

Main entry points: [`src/system/Model.java`](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/Model.java) (People and test operations), [`src/gui/App.java`](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/gui/App.java) (Swing application), [`src/gui/controller/AppController.java`](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/gui/controller/AppController.java) (Operation controller), [`src/linearHashFile/LinearHashFile.java`](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/linearHashFile/LinearHashFile.java) (Linear hash index)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["Swing application<br/>[App.java]"]
  node_controller["Operation controller<br/>[AppController.java]"]
  node_opsdata["Operation state"]
  node_panels["Operation and file panels"]
  node_log["Result formatting<br/>[LogFormatter.java]"]
end

subgraph group_domain["PCR records"]
  node_person["Person record<br/>[Person.java]"]
  node_pcrtest["PCR test record<br/>[PCRTest.java]"]
  node_generators["Record and ID generators"]
end

subgraph group_service["Application model"]
  node_model["People and test operations<br/>[Model.java]"]
  node_fileconfig["File configuration<br/>[FileConfig.java]"]
  node_personresults["Person with tests"]
  node_testresults["Test with person"]
  node_personrequest["Person edit request"]
  node_testrequest["Test edit request"]
end

subgraph group_storage["Persistent storage"]
  node_hash["Linear hash index"]
  node_heap[("Heap file<br/>[HeapFile.java]")]
  node_block["Fixed-record blocks<br/>[Block.java]"]
end

node_user(("User"))
node_tester["Heap and hash testers"]

node_user -->|"operates"| node_app
node_app -->|"dispatches"| node_controller
node_app -->|"uses"| node_opsdata
node_app -->|"renders"| node_panels
node_app -->|"formats results"| node_log
node_controller -->|"delegates"| node_model
node_app -->|"displays"| node_person
node_app -->|"displays"| node_pcrtest
node_controller -->|"creates"| node_personrequest
node_controller -->|"creates"| node_testrequest
node_controller -->|"accepts"| node_fileconfig
node_model -->|"manages"| node_person
node_model -->|"manages"| node_pcrtest
node_model -->|"generates"| node_generators
node_model -->|"returns"| node_personresults
node_model -.->|"returns"| node_testresults
node_model -.->|"applies edits"| node_personrequest
node_model -->|"applies edits"| node_testrequest
node_model -->|"configures files"| node_fileconfig
node_model -->|"operates on"| node_hash
node_hash -->|"reads and writes"| node_heap
node_hash -->|"manages blocks"| node_block
node_heap -->|"serializes"| node_block
node_tester -->|"exercises"| node_heap
node_tester -.->|"exercises"| node_hash

click node_app "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/gui/App.java"
click node_controller "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/gui/controller/AppController.java"
click node_opsdata "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/gui/data/OperationsData.java"
click node_panels "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/tree/master/src/gui/panels"
click node_log "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/gui/util/LogFormatter.java"
click node_model "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/Model.java"
click node_fileconfig "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/data/FileConfig.java"
click node_personresults "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/data/PersonAndTests.java"
click node_testresults "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/data/TestWithPerson.java"
click node_personrequest "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/data/PersonEditRequest.java"
click node_testrequest "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/data/PCRTestEditRequest.java"
click node_person "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/person/Person.java"
click node_pcrtest "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/pcrtest/PCRTest.java"
click node_generators "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/tree/master/src/generators"
click node_hash "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/linearHashFile/LinearHashFile.java"
click node_heap "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/heapfile/HeapFile.java"
click node_block "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/block/Block.java"
click node_tester "https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/tree/master/src/tester"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_controller,node_opsdata,node_panels,node_log,node_user toneBlue
class node_person,node_pcrtest,node_generators toneAmber
class node_model,node_fileconfig,node_personresults,node_testresults,node_personrequest,node_testrequest toneMint
class node_hash,node_heap,node_block toneRose
class node_tester toneTeal
```

## Components

### Desktop interface

- [Swing application](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/gui/App.java): `src/gui/App.java`
- [Operation controller](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/gui/controller/AppController.java): `src/gui/controller/AppController.java`
- [Operation state](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/gui/data/OperationsData.java): `src/gui/data/OperationsData.java`
- [Operation and file panels](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/tree/master/src/gui/panels): `src/gui/panels`
- [Result formatting](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/gui/util/LogFormatter.java): `src/gui/util/LogFormatter.java`

### PCR records

- [Person record](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/person/Person.java): `src/person/Person.java`
- [PCR test record](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/pcrtest/PCRTest.java): `src/pcrtest/PCRTest.java`
- [Record and ID generators](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/tree/master/src/generators): `src/generators`

### Application model

- [People and test operations](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/Model.java): `src/system/Model.java`
- [File configuration](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/data/FileConfig.java): `src/system/data/FileConfig.java`
- [Person with tests](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/data/PersonAndTests.java): `src/system/data/PersonAndTests.java`
- [Test with person](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/data/TestWithPerson.java): `src/system/data/TestWithPerson.java`
- [Person edit request](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/data/PersonEditRequest.java): `src/system/data/PersonEditRequest.java`
- [Test edit request](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/system/data/PCRTestEditRequest.java): `src/system/data/PCRTestEditRequest.java`

### Persistent storage

- [Linear hash index](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/linearHashFile/LinearHashFile.java): `src/linearHashFile/LinearHashFile.java`
- [Heap file](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/heapfile/HeapFile.java): `src/heapfile/HeapFile.java`
- [Fixed-record blocks](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/blob/master/src/block/Block.java): `src/block/Block.java`

### Other components

- **User**
- [Heap and hash testers](https://github.com/maryoxd/algorithms-and-data-structures-linear-hashing/tree/master/src/tester): `src/tester`

## Connections

- User → Swing application: operates (evidence: `src/gui/App.java`)
- Swing application → Operation controller: dispatches (evidence: `src/gui/App.java`)
- Swing application → Operation state: uses (evidence: `src/gui/App.java`)
- Swing application → Operation and file panels: renders (evidence: `src/gui/App.java`)
- Swing application → Result formatting: formats results (evidence: `src/gui/App.java`)
- Operation controller → People and test operations: delegates (evidence: `src/gui/controller/AppController.java`)
- Swing application → Person record: displays (evidence: `src/gui/App.java`)
- Swing application → PCR test record: displays (evidence: `src/gui/App.java`)
- Operation controller → Person edit request: creates (evidence: `src/gui/controller/AppController.java`)
- Operation controller → Test edit request: creates (evidence: `src/gui/controller/AppController.java`)
- Operation controller → File configuration: accepts (evidence: `src/gui/controller/AppController.java`)
- People and test operations → Person record: manages (evidence: `src/system/Model.java`)
- People and test operations → PCR test record: manages (evidence: `src/system/Model.java`)
- People and test operations → Record and ID generators: generates (evidence: `src/system/Model.java`)
- People and test operations → Person with tests: returns (evidence: `src/system/Model.java`)
- People and test operations → Test with person: returns (evidence: `src/system/Model.java`)
- People and test operations → Person edit request: applies edits (evidence: `src/system/Model.java`)
- People and test operations → Test edit request: applies edits (evidence: `src/system/Model.java`)
- People and test operations → File configuration: configures files (evidence: `src/system/Model.java`)
- People and test operations → Linear hash index: operates on (evidence: `src/system/Model.java`)
- Linear hash index → Heap file: reads and writes (evidence: `src/linearHashFile/LinearHashFile.java`)
- Linear hash index → Fixed-record blocks: manages blocks (evidence: `src/linearHashFile/LinearHashFile.java`)
- Heap file → Fixed-record blocks: serializes (evidence: `src/heapfile/HeapFile.java`)
- Heap and hash testers → Heap file: exercises (evidence: `src/tester/HeapFunctionalityTester.java`)
- Heap and hash testers → Linear hash index: exercises (evidence: `src/tester/HashFunctionalityTester.java`)
