Skip to content

Latest commit

 

History

History
142 lines (91 loc) · 3.81 KB

README.md

File metadata and controls

142 lines (91 loc) · 3.81 KB

Topology API

Task 2

📙 About

An API library which provides the functionality to access, manage and store device topologies.

📝 Description

  1. Read a topology from a given JSON file and store it in the memory.
  2. Write a given topology from the memory to a JSON file.
  3. Query about which topologies are currently in the memory.
  4. Delete a given topology from memory.
  5. Query about which devices are in a given topology.
  6. Query about which devices are connected to a given netlist node in a given topology.

Class Structure

Class Structure

Hierarchy

Class Hierarchy

🏁 Getting Started

Classes

Main

  • This class creates an object from the API class which is used to call each functionality
  • It contains the main loop of the API which allows the user to select which operation to perform

API

This class contains the memory of the API as a HashMap and an addToMemory function to store in it.

  • This class contains the functions of the API :-

    • boolean readJSON(String fileName)
    • boolean writeJSON(String topologyID)
    • Set getTopologies()
    • boolean deleteTopology(String topologyID)
    • List queryDevices(String topologyID)
    • List queryDevicesWithNetlistNode(String topologyID, String node)
  • Each functionality is validated completely in case a topology/node not found for example, etc...

Topology

  • Each topology consists of components and the JSON format of the topology, with a unique ID and all nodes between each component in the topology

Nodes

  • The Topology class creates an object from class Nodes in order to set its nodes and add to it any component in the topology

Component

  • Each component contains the ID and type of the component as well as the device details and the NetList

Device

  • This class contains the device details including it's name, default value , min and max

Resistor

  • The resistor inherits from class device and overrides function print() to add resistance as its type

Transistor

  • The transistor inherits from class device and has an extra variable (type) to indicate whether it's an nmos or a pmos transistor and overrides the print function as well

Testing

  • This class tests each function of class API

Dependencies

  • Java
  • Maven Framework Support
  • json.simple

Documentation

  • Found in the index.html file inside the documentation folder

💻 Installing

git clone https://github.com/AbdelrahmanHamdyy/Topology-API 

📷 Screenshots

Query Topologies

1

Read JSON file & Query Topologies

2

Write JSON

3

Delete a topology & Query Topologies

4

Query devices in a topology

5

Query devices with netlist node

6

Exit

7

Testing

8

Contributors

Abdelrahman Hamdy
Abdelrahman Hamdy

License

This project is licensed under the [MIT] License - see the LICENSE.md file for details