我有幾類:嵌套泛型
標準類:
WorkflowGraphModel:
public class WorkflowGraphModel<T> implements IWorkflowGraphModel<T>
public WorkflowGraphModel(List<IWorkflowGraphEntry<T>> entries)
{
this.entries = entries;
}
WorkflowGraphEntry:
public class WorkflowGraphEntry<T> implements IWorkflowGraphEntry<T>
特殊的實現:
ApprovalStepGraphEntry
public class ApprovalStepGraphEntry extends WorkflowGraphEntry<ApprovalStep>
ApprovalStepGraphModel
public class ApprovalStepGraphModel extends WorkflowGraphModel<ApprovalStepGraphEntry>
public ApprovalStepGraphModel(List<ApprovalStepGraphEntry> stepEntries)
{
super(stepEntries);
}
有主叫
super(stepEntries);
WorkflowGraphModel(java.util.List中>)時是一個錯誤in WorkflowGraphModel
不能應用於(java.util.List)
我不知道爲什麼編譯器不知道ApprovalStepGraphEntry
實現IWorkflowGraphEntry
。在我看來,泛型很好。
感謝你,幫助! – Rooboo 2013-03-04 09:34:55