Codota Logo
Prototype
Code IndexAdd Codota to your IDE (free)

How to use
Prototype
in
com.android.dx.rop.type

Best Java code snippets using com.android.dx.rop.type.Prototype (Showing top 20 results out of 315)

  • Common ways to obtain Prototype
private void myMethod () {
Prototype p =
  • Codota IconString descriptor;Prototype.intern(descriptor)
  • Codota IconCstMethodRef ref;ref.getPrototype()
  • Codota IconConcreteMethod method;method.getEffectiveDescriptor()
  • Smart code suggestions by Codota
}
origin: linkedin/dexmaker

Prototype prototype(boolean includeThis) {
  return Prototype.intern(descriptor(includeThis));
}
origin: dodola/RocooFix

private void checkPrototype(Prototype proto) {
 checkDescriptor(proto.getReturnType().getDescriptor());
 StdTypeList args = proto.getParameterTypes();
 for (int i = 0; i < args.size(); i++) {
   checkDescriptor(args.get(i).getDescriptor());
 }
}
private void checkDescriptor(String typeDescriptor) {
origin: com.google.android.tools/dx

Type[] params = makeParameterArray(descriptor);
int paramCount = 0;
int at = 1;
result = new Prototype(descriptor, returnType, parameterTypes);
return putIntern(result);
origin: com.android.tools.build/builder

/**
 * Interns an instance, adding to the descriptor as necessary based
 * on the given definer, name, and flags. For example, an init
 * method has an uninitialized object of type {@code definer}
 * as its first argument.
 *
 * @param descriptor {@code non-null;} the descriptor string
 * @param definer {@code non-null;} class the method is defined on
 * @param isStatic whether this is a static method
 * @param isInit whether this is an init method
 * @return {@code non-null;} the interned instance
 */
public static Prototype intern(String descriptor, Type definer,
    boolean isStatic, boolean isInit) {
  Prototype base = intern(descriptor);
  if (isStatic) {
    return base;
  }
  if (isInit) {
    definer = definer.asUninitialized(Integer.MAX_VALUE);
  }
  return base.withFirstParameter(definer);
}
origin: nikita36078/J2ME-Loader

/**
 * Returns a new interned instance, which is the same as this instance,
 * except that it has an additional parameter prepended to the original's
 * argument list.
 *
 * @param param {@code non-null;} the new first parameter
 * @return {@code non-null;} an appropriately-constructed instance
 */
public Prototype withFirstParameter(Type param) {
  String newDesc = "(" + param.getDescriptor() + descriptor.substring(1);
  StdTypeList newParams = parameterTypes.withFirst(param);
  newParams.setImmutable();
  Prototype result =
    new Prototype(newDesc, returnType, newParams);
  return putIntern(result);
}
origin: nikita36078/J2ME-Loader

/**
 * Gets the register that begins the method's parameter range (including
 * the 'this' parameter for non-static methods). The range continues until
 * {@code regSize}
 *
 * @return register as noted above.
 */
private int getParamBase() {
  return regSize
      - desc.getParameterTypes().getWordCount() - (isStatic? 0 : 1);
}
origin: nikita36078/J2ME-Loader

/**
 * {@inheritDoc}
 *
 * In this case, this method returns the <i>return type</i> of this method.
 *
 * @return {@code non-null;} the method's return type
 */
@Override
public final Type getType() {
  return prototype.getReturnType();
}
origin: nikita36078/J2ME-Loader

/** {@inheritDoc} */
@Override
public String toHuman() {
  return prototype.getDescriptor();
}
origin: nikita36078/J2ME-Loader

/**
 * Returns the appropriate {@code invoke-static} rop for the
 * given type. The result is typically a newly-allocated instance.
 *
 * @param meth {@code non-null;} descriptor of the method
 * @return {@code non-null;} an appropriate instance
 */
public static Rop opInvokeStatic(Prototype meth) {
  return new Rop(RegOps.INVOKE_STATIC,
          meth.getParameterFrameTypes(),
          StdTypeList.THROWABLE);
}
origin: nikita36078/J2ME-Loader

/** {@inheritDoc} */
@Override
protected final int compareTo0(Constant other) {
  int cmp = super.compareTo0(other);
  if (cmp != 0) {
    return cmp;
  }
  CstBaseMethodRef otherMethod = (CstBaseMethodRef) other;
  return prototype.compareTo(otherMethod.prototype);
}
origin: com.jakewharton.android.repackaged/dalvik-dx

Type[] params = makeParameterArray(descriptor);
int paramCount = 0;
int at = 1;
return new Prototype(descriptor, returnType, parameterTypes);
origin: nikita36078/J2ME-Loader

/**
 * Gets the prototype of this method as either a
 * {@code static} or instance method. In the case of a
 * {@code static} method, this is the same as the raw
 * prototype. In the case of an instance method, this has an
 * appropriately-typed {@code this} argument as the first
 * one.
 *
 * @param isStatic whether the method should be considered static
 * @return {@code non-null;} the method prototype
 */
public final Prototype getPrototype(boolean isStatic) {
  if (isStatic) {
    return prototype;
  } else {
    if (instancePrototype == null) {
      Type thisType = getDefiningClass().getClassType();
      instancePrototype = prototype.withFirstParameter(thisType);
    }
    return instancePrototype;
  }
}
origin: nikita36078/J2ME-Loader

/**
 * Returns the unique instance corresponding to the
 * given method descriptor. See vmspec-2 sec4.3.3 for details on the
 * field descriptor syntax.
 *
 * @param descriptor {@code non-null;} the descriptor
 * @return {@code non-null;} the corresponding instance
 * @throws IllegalArgumentException thrown if the descriptor has
 * invalid syntax
 */
public static Prototype intern(String descriptor) {
  if (descriptor == null) {
    throw new NullPointerException("descriptor == null");
  }
  Prototype result = internTable.get(descriptor);
  if (result != null) {
    return result;
  }
  result = fromDescriptor(descriptor);
  return putIntern(result);
}
origin: com.google.dexmaker/dexmaker-dx

Type[] params = makeParameterArray(descriptor);
int paramCount = 0;
int at = 1;
result = new Prototype(descriptor, returnType, parameterTypes);
return putIntern(result);
origin: com.google.dexmaker/dexmaker-dx

/**
 * Interns an instance, adding to the descriptor as necessary based
 * on the given definer, name, and flags. For example, an init
 * method has an uninitialized object of type {@code definer}
 * as its first argument.
 *
 * @param descriptor {@code non-null;} the descriptor string
 * @param definer {@code non-null;} class the method is defined on
 * @param isStatic whether this is a static method
 * @param isInit whether this is an init method
 * @return {@code non-null;} the interned instance
 */
public static Prototype intern(String descriptor, Type definer,
    boolean isStatic, boolean isInit) {
  Prototype base = intern(descriptor);
  if (isStatic) {
    return base;
  }
  if (isInit) {
    definer = definer.asUninitialized(Integer.MAX_VALUE);
  }
  return base.withFirstParameter(definer);
}
origin: com.google.android.tools/dx

/**
 * Returns a new interned instance, which is the same as this instance,
 * except that it has an additional parameter prepended to the original's
 * argument list.
 *
 * @param param {@code non-null;} the new first parameter
 * @return {@code non-null;} an appropriately-constructed instance
 */
public Prototype withFirstParameter(Type param) {
  String newDesc = "(" + param.getDescriptor() + descriptor.substring(1);
  StdTypeList newParams = parameterTypes.withFirst(param);
  newParams.setImmutable();
  Prototype result =
    new Prototype(newDesc, returnType, newParams);
  return putIntern(result);
}
origin: nikita36078/J2ME-Loader

/**
 * Gets the register that begins the method's parameter range (including
 * the 'this' parameter for non-static methods). The range continues until
 * {@code regSize}
 *
 * @return register as noted above
 */
private int getParamBase() {
  return regSize
      - desc.getParameterTypes().getWordCount() - (isStatic? 0 : 1);
}
origin: com.jakewharton.android.repackaged/dalvik-dx

/**
 * Gets the return type.
 *
 * @return {@code non-null;} the return type
 */
public Type getReturnType() {
  return prototype.getReturnType();
}
origin: com.jakewharton.android.repackaged/dalvik-dx

/** {@inheritDoc} */
@Override
public String toHuman() {
  return prototype.getDescriptor();
}
origin: com.android/dx

/**
 * Returns the appropriate {@code invoke-static} rop for the
 * given type. The result is typically a newly-allocated instance.
 *
 * @param meth {@code non-null;} descriptor of the method
 * @return {@code non-null;} an appropriate instance
 */
public static Rop opInvokeStatic(Prototype meth) {
  return new Rop(RegOps.INVOKE_STATIC,
          meth.getParameterFrameTypes(),
          StdTypeList.THROWABLE);
}
com.android.dx.rop.typePrototype

Javadoc

Representation of a method descriptor. Instances of this class are generally interned and may be usefully compared with each other using ==.

Most used methods

  • intern
    Interns an instance, adding to the descriptor as necessary based on the given definer, name, and fla
  • getParameterTypes
    Gets the list of parameter types.
  • getReturnType
    Gets the return type.
  • <init>
    Constructs an instance. This is a private constructor; use one of the public static methods to get i
  • compareTo
  • getDescriptor
    Gets the descriptor string.
  • getParameterFrameTypes
    Gets the list of frame types corresponding to the list of parameter types. The difference between th
  • makeParameterArray
    Helper for #intern which returns an empty array to populate with parsed parameter types, and which a
  • putIntern
    Puts the given instance in the intern table if it's not already there. If a conflicting value is alr
  • withFirstParameter
    Returns a new interned instance, which is the same as this instance, except that it has an additiona
  • internInts
    Interns an instance which consists of the given number of ints along with the given return type
  • clearInternTable
  • internInts,
  • clearInternTable,
  • equals,
  • fromDescriptor,
  • hashCode,
  • toString

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Path (java.nio.file)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Table (org.hibernate.mapping)
    A relational table
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now