Untitled

 avatar
unknown
plain_text
2 months ago
1.3 kB
9
Indexable
/**
 * Graph node storing a single artist or song record.
 *
 * @author Leguejou Awunganyi
 * @author Ishita Punna
 * @version 2026-02-08
 */
public class GraphNode {

    /**
     * Name stored for this node.
     */
    private String name;

    /**
     * True when this node represents an artist.
     */
    private boolean artist;

    /**
     * Slot index of this node inside the graph arrays.
     */
    private int index;

    /**
     * Create a graph node.
     *
     * @param nodeName node name
     * @param isArtist true if artist node
     * @param slot     slot index in the graph
     */
    public GraphNode(String nodeName, boolean isArtist, int slot) {
        name = nodeName;
        artist = isArtist;
        index = slot;
    }

    /**
     * Get the stored name.
     *
     * @return node name
     */
    public String getName() {
        return name;
    }

    /**
     * Check whether this is an artist node.
     *
     * @return true for artist nodes
     */
    public boolean isArtist() {
        return artist;
    }

    /**
     * Get the graph slot index.
     *
     * @return slot index
     */
    public int getIndex() {
        return index;
    }
}
Editor is loading...
Leave a Comment