Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Berat02xz committed Jan 21, 2024
1 parent e87f893 commit a3cc8ca
Show file tree
Hide file tree
Showing 9 changed files with 240 additions and 11 deletions.
2 changes: 1 addition & 1 deletion APP/.idea/dataSources.local.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions APP/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@

//-------INTERFACE
public interface Filter {
/**
* @param data Object
* @apiNote This method processes the data.
* @implNote This implementation consists of the data.
* @since 1.0
*/
void process(Object data);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ public JsonFileReaderFilter(Filter nextFilter) {
this.nextFilter = nextFilter;
}

/**
* @param data Object
* @apiNote This method processes the data.
* @implNote This implementation consists of the data.
* @since 1.0
* @see JsonFileReaderFilter
*/
@Override
public void process(Object data) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
import java.util.ArrayList;
import java.util.List;

/**
* @version 1.0
* @apiNote This class represents a museum extractor filter.
* @implNote This implementation consists of the next filter.
* @since 1.0
*/
//-----MUSEUM DATA EXTRACTOR FROM JSON FILE
public class MuseumExtractorFilter implements Filter{
private final Filter nextFilter;
Expand All @@ -20,7 +26,17 @@ public MuseumExtractorFilter(Filter nextFilter) {
private static List<Museum> museums = new ArrayList<>();



/**
* @param input String
* @return List<Museum>
* @apiNote This method searches the museums in the list of museums. Filters them by name. Returns a list of museums.
* @implNote This implementation consists of the input.
* @since 1.0
*
* @deprecated
* reason: This method is not used anymore. Data has already been filtered and stored in the database.
*
*/
public static List<Museum> searchmuseums(String input) {
List<Museum> museums = getMuseums();
List<Museum> filteredMuseums = new ArrayList<>();
Expand All @@ -32,6 +48,14 @@ public static List<Museum> searchmuseums(String input) {
return filteredMuseums;
}

/**
* @return List<Museum>
* @apiNote This method returns a list of museums.
* @implNote This implementation consists of the museums.
* @since 1.0
* @see Museum
* @deprecated
*/
public static List<Museum> getOpenNow() {
List<Museum> museums = getMuseums();
List<Museum> filteredMuseums = new ArrayList<>();
Expand Down Expand Up @@ -76,6 +100,13 @@ public static List<Museum> getSkopje() {
return filteredMuseums;
}

/**
* @param data Object
* @apiNote This method processes the data. Takes tags like name, latitude, longitude, street, email, internetAccess, wikidata, openingHours, phone, fee, charge and website.
* @implNote This implementation consists of the data.
* @since 1.0
* @see MuseumExtractorFilter
*/
@Override
public void process(Object data) {
JsonNode jsonData = (JsonNode) data;
Expand All @@ -96,6 +127,18 @@ public void process(Object data) {
}
}

/**
* @param node JsonNode
* @return Museum
* @apiNote This method creates a museum.
* @implNote This implementation consists of the node.
* @since 1.0
*
* @Note Only Use this when you want to add new fresh list of museums to the database from the export[number].json file.
* @see MuseumExtractorFilter
* @deprecated
*
*/
private Museum createMuseum(JsonNode node) {
JsonNode tags = node.get("tags");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@

import java.util.List;

//MUSEUM CLASS

/**
* @version 1.0
* @apiNote This class represents a museum.
* @implNote This implementation consists of the name, latitude, longitude, street, email, internetAccess, wikidata, openingHours, phone, fee, charge and website.
* @since 1.0
*
*/
@Data
@Entity
@Table(name = "Museums")
Expand All @@ -15,6 +22,13 @@ public Museum() {

}

/**
* @return String
* @apiNote Returns a string representation of the object.
* @implNote This implementation returns a string representation consisting of the name, latitude, longitude, street, email, internetAccess, wikidata, openingHours, phone, fee, charge and website.
* @since 1.0
*
*/
@Override
public String toString() {
return "Museum{" +
Expand All @@ -33,6 +47,7 @@ public String toString() {
'}';
}


@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
import lombok.Getter;


/**
* @version 1.0
* @apiNote This class represents a museum.
* @implNote This implementation consists of the name, latitude, longitude, street, email, internetAccess, wikidata, openingHours, phone, fee, charge and website.
* @since 1.0
*/
@Data
@Entity
@Table(name = "Reviews")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
import jakarta.persistence.*;
import lombok.Data;

/**
* @version 1.0
* @apiNote This class represents a user.
* @implNote This implementation consists of the username, password, email and role.
* @since 1.0
* @see User
*/
@Data
@Entity
@Table(name = "Users")
Expand Down
Loading

0 comments on commit a3cc8ca

Please sign in to comment.