Skip to content

Database Class

Arthur Yoshikasu Arakaki edited this page Jul 2, 2025 · 2 revisions

Database Class

Class Information

Class Declaration:

public final class Database

Known Subclasses: N/A(Since it is final)

Superclass: java.lang.Object

Implemented Interfaces: none

Package: io.github.demnetwork.sjdb

Constructors

No Public constructors.

Methods

public void save(String user, String password) throws Throwable

This method saves the Database into a file

Parameters:

  • user - The new username

  • password - the new password

Throws:

  • java.lang.Throwable - When something does not work properly

public void setElement(DBElement<?> e, int index)

Sets the element at index index with the Object e

Parameters:

  • e - Element to set into a Database Root Index

  • index - Index to put the e Object

Throws:

  • ArrayIndexOutOfBounds - If the index is negative or it is above or equals to RootMaxLength

public Object get(int index)

This method returns the Object at index index in the root

Parameters:

  • index - Index to retrieve the Object

Throws:

  • ArrayIndexOutOfBounds - If the index is negative or it is above or equals to RootMaxLength

public DBRootElement getRoot()

Returns the Database root of this Database Instance.

Parameters:

  • none

Throws:

  • Error(If the JVM Runs out of memory or if something went wrong with the JVM)