Java クラスに実装されていない関数の階層を作成しました。既に実装されている関数を考慮して、実装できる関数を追跡したいと考えています。
例として、実装されていない関数の依存関係の長いチェーンを次に示します。これをプログラムで分析して、どの関数を実装できるかを判断します (既に実装されている関数がある場合)。
//requires the functions b and c
public static void a(){
}
//does not require any functions to be implemented before being implemented
public static void b(){
}
//requires the function b
public static void c(){
}
public static void d(){ //requires the function a
}
public static void e(){ //requires the function a and c
}
public static void f(){ //requires the function a and c
}
//requires the functions a and f
public static void g(){
}
上記の関数のどれをここで実装できるかを判断する方法はありますか (既に実装されている関数のリストが与えられた場合)。Javascript では、この問題を解決するのは簡単ですが (関数のプロトタイプで各関数のプロパティを設定できるため)、Java では、単純で簡潔な解決策をまだ見つけていません。