Package xscript.runtime.genericclass

Source Code of xscript.runtime.genericclass.XGenericMethodProviderImp

package xscript.runtime.genericclass;

import xscript.runtime.XRuntimeException;
import xscript.runtime.method.XMethod;
import xscript.runtime.threads.XGenericMethodProvider;

public class XGenericMethodProviderImp implements XGenericMethodProvider {

  private XMethod method;
  private XGenericClass[] genericClasses;
 
  public XGenericMethodProviderImp(XMethod method, XGenericClass[] genericClasses){
    this.method = method;
    this.genericClasses = genericClasses;
    if(method.getGenericParams()!=genericClasses.length)
      throw new XRuntimeException("Wrong count of generics");
  }
 
  @Override
  public XMethod getMethod() {
    return method;
  }

  @Override
  public XGenericClass getGeneric(int genericID) {
    return genericClasses[genericID];
  }

}
TOP

Related Classes of xscript.runtime.genericclass.XGenericMethodProviderImp

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.