Package org.jf.dexlib2.base
Class BaseExceptionHandler
- java.lang.Object
-
- org.jf.dexlib2.base.BaseExceptionHandler
-
- All Implemented Interfaces:
java.lang.Comparable<ExceptionHandler>
,ExceptionHandler
- Direct Known Subclasses:
BuilderExceptionHandler
,BuilderExceptionHandler
,DexBackedExceptionHandler
,ExceptionHandlerRewriter.RewrittenExceptionHandler
,ImmutableExceptionHandler
public abstract class BaseExceptionHandler extends java.lang.Object implements ExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<ExceptionHandler>
BY_EXCEPTION
-
Constructor Summary
Constructors Constructor Description BaseExceptionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ExceptionHandler o)
Compare this ExceptionHandler to another ExceptionHandler.boolean
equals(java.lang.Object o)
Compares this ExceptionHandler to another ExceptionHandler for equality.TypeReference
getExceptionTypeReference()
Gets the type of exception that is handled by this handler.int
hashCode()
Returns a hashcode for this ExceptionHandler.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jf.dexlib2.iface.ExceptionHandler
getExceptionType, getHandlerCodeAddress
-
-
-
-
Field Detail
-
BY_EXCEPTION
public static final java.util.Comparator<ExceptionHandler> BY_EXCEPTION
-
-
Method Detail
-
getExceptionTypeReference
@Nullable public TypeReference getExceptionTypeReference()
Description copied from interface:ExceptionHandler
Gets the type of exception that is handled by this handler.- Specified by:
getExceptionTypeReference
in interfaceExceptionHandler
- Returns:
- A TypeReference to the type of exception that is handled by this handler, or null if this is a catch-all handler.
-
hashCode
public int hashCode()
Description copied from interface:ExceptionHandler
Returns a hashcode for this ExceptionHandler. This hashCode is defined to be the following:String exceptionType = getExceptionType(); int hashCode = exceptionType==null?0:exceptionType.hashCode(); return hashCode*31 + getHandlerCodeAddress();
- Specified by:
hashCode
in interfaceExceptionHandler
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash code value for this ExceptionHandler
-
equals
public boolean equals(@Nullable java.lang.Object o)
Description copied from interface:ExceptionHandler
Compares this ExceptionHandler to another ExceptionHandler for equality. This ExceptionHandler is equal to another ExceptionHandler if all of it's "fields" are equal. That is, if the return values of getExceptionType() and getHandlerCodeAddress() are both equal.- Specified by:
equals
in interfaceExceptionHandler
- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- The object to be compared for equality with this ExceptionHandler- Returns:
- true if the specified object is equal to this ExceptionHandler
-
compareTo
public int compareTo(@Nonnull ExceptionHandler o)
Description copied from interface:ExceptionHandler
Compare this ExceptionHandler to another ExceptionHandler. The comparison is based on the comparison of the return values of getExceptionType() and getHandlerCodeAddress() in that order. A null value for getExceptionType() compares after a non-null value.- Specified by:
compareTo
in interfacejava.lang.Comparable<ExceptionHandler>
- Specified by:
compareTo
in interfaceExceptionHandler
- Parameters:
o
- The ExceptionHandler to compare with this ExceptionHandler- Returns:
- An integer representing the result of the comparison
-
-