Bind implemented interface used in {@link AbstractCalculator} instances with concrete implementation of {@link Operator} or {@link Function}
@param clazz
@param implementation
960037
public static void bind(Class clazz, Class<? extends Extension> implementation) {
        bind.put(clazz, implementation);
    }
611371
public void bind(SQLiteStatement statement) {
		if (this.compiledStatement != null) {
			// already binded
			return;
		}

		int index = 1;

		statement.clearBindings();
		Object value;

		for (int j = 0; j < args.size(); j++) {
			value = args.get(j);
			switch (valueType.get(index - 1)) {
			case BOOLEAN:
				statement.bindLong(index, (long) (((Boolean) value) == true ? 1 : 0));
				break;
			case BYTE:
				statement.bindLong(index, (byte) value);
				break;
			case SHORT:
				statement.bindLong(index, (short) value);
				break;
			case INTEGER:
				statement.bindLong(index, (int) value);
				break;
			case CHARACTER:
				statement.bindLong(index, Character.getNumericValue((char)value));
				break;
			case LONG:
				statement.bindLong(index, (long) value);
				break;
			case BYTE_ARRAY:
				statement.bindBlob(index, (byte[]) value);
				break;
			case FLOAT:
				statement.bindDouble(index, (float) value);
				break;
			case DOUBLE:
				statement.bindDouble(index, (double) value);
				break;
			case NULL:
				statement.bindNull(index);
				break;
			case STRING:
				statement.bindString(index, (String) value);
				break;
			}
			index++;
		}

		for (int i = 0; i < whereArgs.size(); i++, index++) {
			statement.bindString(index, whereArgs.get(i));
		}
	}
99815
public static TypeDesc bindQueryParam(Class clazz) {
        // This method is a bit vestigial. Once upon a time the Query class did
        // not support all primitive types.
        if (clazz.isPrimitive()) {
            TypeDesc type = TypeDesc.forClass(clazz);
            switch (type.getTypeCode()) {
            case TypeDesc.INT_CODE:
            case TypeDesc.LONG_CODE:
            case TypeDesc.FLOAT_CODE:
            case TypeDesc.DOUBLE_CODE:
            case TypeDesc.BOOLEAN_CODE:
            case TypeDesc.CHAR_CODE:
            case TypeDesc.BYTE_CODE:
            case TypeDesc.SHORT_CODE:
                return type;
            }
        }
        return TypeDesc.OBJECT;
    }
848882
public final void put(final SgClass clasz) {
        if (clasz == null) {
            throw new IllegalArgumentException("The argument 'clasz' cannot be null!");
        }
        cache.put(clasz.getName(), clasz);
    }
158486
private void updateBind(Node n) {
    CodingConvention.Bind bind =
        compiler.getCodingConvention().describeFunctionBind(n, false, true);
    if (bind == null) {
      return;
    }

    Node target = bind.target;
    FunctionType callTargetFn = getJSType(target)
        .restrictByNotNullOrUndefined().toMaybeFunctionType();
    if (callTargetFn == null) {
      return;
    }

    if (bind.thisValue != null && target.isFunction()) {
      JSType thisType = getJSType(bind.thisValue);
      if (thisType.toObjectType() != null && !thisType.isUnknownType()
          && callTargetFn.getTypeOfThis().isUnknownType()) {
        callTargetFn =
            FunctionType.builder(registry)
                .copyFromOtherFunction(callTargetFn)
                .withTypeOfThis(thisType.toObjectType())
                .build();
        target.setJSType(callTargetFn);
      }
    }

    n.setJSType(
        callTargetFn.getBindReturnType(
            // getBindReturnType expects the 'this' argument to be included.
            bind.getBoundParameterCount() + 1));
  }
878510
public function bind($abstract, $concrete = null, $shared = false)
		{
			// If the given types are actually an array, we will assume an alias is being
			// defined and will grab this "real" abstract class name and register this
			// alias with the container so that it can be used as a shortcut for it.
			if (Arrays::is($abstract)) {
				list($abstract, $alias) = $this->extractAlias($abstract);

				$this->alias($abstract, $alias);
			}

			// If no concrete type was given, we will simply set the concrete type to the
			// abstract type. This will allow concrete type to be registered as shared
			// without being forced to state their classes in both of the parameter.
			$this->dropStaleInstances($abstract);

			if (is_null($concrete)) {
				$concrete = $abstract;
			}

			// If the factory is not a Closure, it means it is just a class name which is
			// is bound into this container to the abstract type and we will just wrap
			// it up inside a Closure to make things more convenient when extending.
			if ( ! $concrete instanceof Closure) {
				$concrete = $this->getClosure($abstract, $concrete);
			}

			$bound = $this->bound($abstract);

			$this->bindings[$abstract] = compact('concrete', 'shared');

			// If the abstract type was already bound in this container, we will fire the
			// rebound listener so that any objects which have already gotten resolved
			// can have their copy of the object updated via the listener callbacks.
			if ($bound) {
				$this->rebound($abstract);
			}
		}
841125
protected void compileProperties(Class<?> clazz) {
        compiled.putAll(defaults);
        compiled.putAll(propertyProvider.provide(classLoader, clazz));
    }
194590
public static LinkedHashSet<Class<?>> getInterfaces(Class<?> clazz) throws ReflectionException {
        Validate.notNull(clazz);

        try {
            LinkedHashSet<Class<?>> interfaces = new LinkedHashSet<>();
            interfaces.addAll(Arrays.asList(clazz.getInterfaces()));
            LinkedHashSet<Class<?>> superclasses = getSuperclasses(clazz);
            for (Class<?> superclass : superclasses) {
                interfaces.addAll(Arrays.asList(superclass.getInterfaces()));
            }
            return interfaces;
        } catch (Exception e) {
            throw new ReflectionException(e);
        }
    }
1090790
public Bindings bind(FunctionMapper fnMapper, VariableMapper varMapper) {
		return bind(fnMapper, varMapper, null);
	}
442680
public void setClazz(Class<? extends ElementBase> clazz) {
        this.clazz = clazz;

        try {
            // Force execution of static initializers
            Class.forName(clazz.getName());
        } catch (ClassNotFoundException e) {
            MiscUtil.toUnchecked(e);
        }
    }
452081
private void addBinding(Binding<?, ?, V> binding)
	{
		bindings.add(binding);
		
		// prevent infinite loop when binder bound by itself
		if (binding.getSource() != this)
		{
			updateViolations();
			
			// TODO: aggregate violations better; ideally provide a live view
			binding.addObservableListener(new ObservableListener<Collection<V>>()
			{
				public void valueChanged(ObservableEvent<Collection<V>> event)
				{
					updateViolations();
				}
			});
		}
	}
679274
public <G extends T> RendererBuilder<T> bind(Class<G> clazz, Renderer<? extends G> prototype) {
    if (clazz == null || prototype == null) {
      throw new IllegalArgumentException(
          "The binding RecyclerView binding can't be configured using null instances");
    }
    prototypes.add(prototype);
    binding.put(clazz, prototype.getClass());
    return this;
  }
699071
public void register(String simpleName, Class<? extends T> clazz) {
        this.constructors.put(simpleName, clazz);
    }
604778
public static <T> Method getFunctionInterfaceMethod(Class<?> clz) {
    if (!clz.isInterface()) {
      return null;
    }
    Method[] ms = Stream.of(clz.getMethods())
        .filter(m -> !(m.isDefault() || m.isBridge() || m.isSynthetic() || Modifier.isStatic(m.getModifiers())))
        .toArray(Method[]::new);
    if (ms.length != 1) {
      return null;
    }
    return ms[0];
  }
784730
protected void bindExecutor(final Class<? extends RepositoryExecutor> executor) {
        bind(executor).in(Singleton.class);
        executorsMultibinder.addBinding().to(executor);
    }
91526
private void visitClass(final Class clazz) {
        Method[] methods = clazz.getDeclaredMethods();
        for (Method method : methods) {
            Class<?>[] exceptionTypes = method.getExceptionTypes();
            String[] exceptions = new String[exceptionTypes.length];
            for (int i = 0; i < exceptions.length; i++) {
                exceptions[i] = BytecodeHelper.getClassInternalName(exceptionTypes[i]);
            }
            // for each method defined in the class, generate the appropriate delegation bytecode
            visitMethod(method.getModifiers(),
                    method.getName(),
                    BytecodeHelper.getMethodDescriptor(method.getReturnType(), method.getParameterTypes()),
                    null,
                    exceptions);
        }
        Constructor[] constructors = clazz.getDeclaredConstructors();
        for (Constructor method : constructors) {
            Class<?>[] exceptionTypes = method.getExceptionTypes();
            String[] exceptions = new String[exceptionTypes.length];
            for (int i = 0; i < exceptions.length; i++) {
                exceptions[i] = BytecodeHelper.getClassInternalName(exceptionTypes[i]);
            }
            // for each method defined in the class, generate the appropriate delegation bytecode
            visitMethod(method.getModifiers(),
                    "<init>",
                    BytecodeHelper.getMethodDescriptor(Void.TYPE, method.getParameterTypes()),
                    null,
                    exceptions);
        }

        for (Class intf : clazz.getInterfaces()) {
            visitClass(intf);
        }
        Class superclass = clazz.getSuperclass();
        if (superclass != null) visitClass(superclass);

        // Ultimately, methods can be available in the closure map which are not defined by the superclass
        // nor the interfaces
        for (Map.Entry<String, Boolean> entry : delegatedClosures.entrySet()) {
            Boolean visited = entry.getValue();
            if (!visited) {
                String name = entry.getKey();
                if (!"*".equals(name)) {
                    // generate a new method
                    visitMethod(ACC_PUBLIC, name, "([Ljava/lang/Object;)Ljava/lang/Object;", null, null);
                }
            }
        }
    }
482684
private static <T> T cast(Class<T> clazz, Object o) {
        if (! clazz.isInstance(o))
            throw new IllegalArgumentException(o.toString());
        return clazz.cast(o);
    }