// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.

package com.intellij.packageDependencies.ui;

import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;

import java.util.Set;

public class RootNode extends PackageDependenciesNode {
  public RootNode(@NotNull Project project) {
    super(project);
  }

  public boolean equals(Object obj) {
    return obj instanceof RootNode;
  }

  public int hashCode() {
    return 0;
  }

  @SuppressWarnings({"HardCodedStringLiteral"})
  public String toString() {
    return "Root";
  }

  @Override
  public void fillFiles(Set<? super PsiFile> set, boolean recursively) {
    super.fillFiles(set, recursively);
    int count = getChildCount();
    for (int i = 0; i < count; i++) {
      PackageDependenciesNode child = (PackageDependenciesNode)getChildAt(i);
      child.fillFiles(set, true);
    }
  }
}