Class TypeIdsSection


public final class TypeIdsSection extends UniformItemSection
Type identifiers list section of a .dex file.
  • Constructor Details

    • TypeIdsSection

      public TypeIdsSection(DexFile file)
      Constructs an instance. The file offset is initially unknown.
      Parameters:
      file - non-null; file that this instance is part of
  • Method Details

    • items

      public Collection<? extends Item> items()
      Gets the collection of all the items in this section. It is not valid to attempt to change the returned list.
      Specified by:
      items in class Section
      Returns:
      non-null; the items
    • get

      public IndexedItem get(Constant cst)
      Gets the item corresponding to the given Constant. This will throw an exception if the constant is not found, including if this instance isn't the sort that maps constants to IndexedItem instances.
      Specified by:
      get in class UniformItemSection
      Parameters:
      cst - non-null; constant to look for
      Returns:
      non-null; the corresponding item found in this instance
    • writeHeaderPart

      public void writeHeaderPart(AnnotatedOutput out)
      Writes the portion of the file header that refers to this instance.
      Parameters:
      out - non-null; where to write
    • intern

      public TypeIdItem intern(Type type)
      Interns an element into this instance.
      Parameters:
      type - non-null; the type to intern
      Returns:
      non-null; the interned reference
    • intern

      public TypeIdItem intern(CstType type)
      Interns an element into this instance.
      Parameters:
      type - non-null; the type to intern
      Returns:
      non-null; the interned reference
    • indexOf

      public int indexOf(Type type)
      Gets the index of the given type, which must have been added to this instance.
      Parameters:
      type - non-null; the type to look up
      Returns:
      >= 0; the reference's index
    • indexOf

      public int indexOf(CstType type)
      Gets the index of the given type, which must have been added to this instance.
      Parameters:
      type - non-null; the type to look up
      Returns:
      >= 0; the reference's index
    • orderItems

      protected void orderItems()
      Alters or picks the order for items in this instance if desired, so that subsequent calls to Section.items() will yield a so-ordered collection. If the items in this instance are indexed, then this method should also assign indices.
      Specified by:
      orderItems in class UniformItemSection