Class BaseStringReference

java.lang.Object
org.jf.dexlib2.base.reference.BaseReference
org.jf.dexlib2.base.reference.BaseStringReference
All Implemented Interfaces:
CharSequence, Comparable<CharSequence>, Reference, StringReference
Direct Known Subclasses:
BuilderStringReference, DexBackedStringReference, ImmutableStringReference

public abstract class BaseStringReference extends BaseReference implements StringReference
  • Constructor Details

    • BaseStringReference

      public BaseStringReference()
  • Method Details

    • hashCode

      public int hashCode()
      Description copied from interface: StringReference
      Returns a hashcode for this StringReference. This is defined to be getString().hashCode().
      Specified by:
      hashCode in interface StringReference
      Overrides:
      hashCode in class Object
      Returns:
      The hash code value for this StringReference
    • equals

      public boolean equals(@Nullable Object o)
      Description copied from interface: StringReference
      Compares this StringReference to another CharSequence for equality. String StringReference is equal to a CharSequence iff this.getString().equals(other.toString()). Equivalently, This StringReference is equal to another StringReference iff this.getString().equals(other.getString()).
      Specified by:
      equals in interface StringReference
      Overrides:
      equals in class Object
      Parameters:
      o - The object to be compared for equality with this TypeReference
      Returns:
      true if the specified object is equal to this TypeReference
    • compareTo

      public int compareTo(@Nonnull CharSequence o)
      Description copied from interface: StringReference
      Compare this StringReference to another StringReference, or more generally to another CharSequence. The comparison is defined to be this.getString().compareTo(other.toString()).
      Specified by:
      compareTo in interface Comparable<CharSequence>
      Specified by:
      compareTo in interface StringReference
      Parameters:
      o - The CharSequence to compare with this StringReference
      Returns:
      An integer representing the result of the comparison
    • length

      public int length()
      Specified by:
      length in interface CharSequence
    • charAt

      public char charAt(int index)
      Specified by:
      charAt in interface CharSequence
    • subSequence

      public CharSequence subSequence(int start, int end)
      Specified by:
      subSequence in interface CharSequence
    • toString

      @Nonnull public String toString()
      Specified by:
      toString in interface CharSequence
      Overrides:
      toString in class Object