/*
 * Copyright 2014 The Kythe Authors. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.devtools.kythe.analyzers.base;

/** Schema-defined Kythe edge kinds. */
public enum EdgeKind {
  DEFINES(true, "defines"),
  DEFINES_BINDING(true, "defines/binding"),
  DOCUMENTS(true, "documents"),
  TAGGED(true, "tagged"),

  // Edges from an anchor.
  COMPLETES(true, "completes"),
  COMPLETES_UNIQUELY(true, "completes/uniquely"),
  IMPUTES(true, "imputes"),
  REF(true, "ref"),
  REF_CALL(true, "ref/call"),
  REF_DOC(true, "ref/doc"),
  REF_FILE(true, "ref/file"),
  REF_IMPORTS(true, "ref/imports"),

  ALIASES("aliases"),
  ANNOTATED_BY("annotatedby"),
  BOUNDED_LOWER("bounded/lower"),
  BOUNDED_UPPER("bounded/upper"),
  CHILDOF("childof"),
  DEPENDS("depends"),
  EXPORTS("exports"),
  EXTENDS("extends"),
  GENERATES("generates"),
  NAMED("named"),
  OVERRIDES("overrides"),
  OVERRIDES_TRANSITIVE("overrides/transitive"),
  PARAM("param"),
  TYPED("typed");

  private static final String EDGE_PREFIX = "/kythe/edge/";

  private final boolean isAnchorEdge;
  private final String kind;

  EdgeKind(boolean isAnchorEdge, String kind) {
    this.isAnchorEdge = isAnchorEdge;
    this.kind = EDGE_PREFIX + kind;
  }

  EdgeKind(String kind) {
    this(false, kind);
  }

  /** Returns {@code true} if the edge is used for {@link NodeKind.ANCHOR}s. */
  public final boolean isAnchorEdge() {
    return isAnchorEdge;
  }

  /** Returns the edge kind's Kythe GraphStore value. */
  public final String getValue() {
    return kind;
  }

  @Override
  public String toString() {
    return kind;
  }
}

@@ -858,16 +858,48 @@
 agged%22),
+%0A  UNDEFINES(true, %22undefines%22),
 %0A%0A  // E
@@ -1089,115 +1089,473 @@
 REF_
-DOC(true, %22ref/doc%22),%0A  REF_FILE(true, %22ref/file%22),%0A  REF_IMPORTS(true, %22ref/imports%22),%0A%0A  ALIASES(%22aliases
+CALL_IMPLICIT(true, %22ref/call/implicit%22),%0A  REF_DOC(true, %22ref/doc%22),%0A  REF_EXPANDS(true, %22ref/expands%22),%0A  REF_EXPANDS_TRANSITIVE(true, %22ref/expands/transitive%22),%0A  REF_FILE(true, %22ref/file%22),%0A  REF_IMPLICIT(true, %22ref/implicit%22),%0A  REF_IMPORTS(true, %22ref/imports%22),%0A  REF_INCLUDES(true, %22ref/includes%22),%0A  REF_INIT(true, %22ref/init%22),%0A  REF_INIT_IMPLICIT(true, %22ref/init/implicit%22),%0A  REF_QUERIES(%22ref/queries%22),%0A%0A  ALIASES(%22aliases%22),%0A  ALIASES_ROOT(%22aliases/root
 %22),%0A
@@ -1671,24 +1671,62 @@
 %22childof%22),%0A
+  CHILDOF_CONTEXT(%22childof/context%22),%0A
   DEPENDS(%22d
@@ -1805,16 +1805,104 @@
 ates%22),%0A
+  INSTANTIATES(%22instantiates%22),%0A  INSTANTIATES_SPECULATIVE(%22instantiates/speculative%22),%0A
   NAMED(
@@ -1933,24 +1933,60 @@
 verrides%22),%0A
+  OVERRIDES_ROOT(%22overrides/root%22),%0A
   OVERRIDES_
@@ -2039,16 +2039,126 @@
 aram%22),%0A
+  SATISFIES(%22satisfies%22),%0A  SPECIALIZES(%22specializes%22),%0A  SPECIALIZES_SPECULATIVE(%22specializes/speculative%22),%0A
   TYPED(

Add missing edge kinds to the Java schema library. (#2976)