// Path: Bindroid/src/com/bindroid/utils/EqualityComparer.java
// public interface EqualityComparer<T> {
//   boolean equals(T obj1, T obj2);
// }
// 
// Path: Bindroid/src/com/bindroid/utils/ObjectUtilities.java
// public class ObjectUtilities {
//   private static EqualityComparer<Object> defaultComparer;
// 
//   static {
//     ObjectUtilities.defaultComparer = new EqualityComparer<Object>() {
//       @Override
//       public boolean equals(Object obj1, Object obj2) {
//         return ObjectUtilities.equals(obj1, obj2);
//       }
//     };
//   }
// 
//   /**
//    * Safely compares two objects for equality, even if the objects are null.
//    * 
//    * @param obj1
//    *          an object to check for equality.
//    * @param obj2
//    *          an object to check for equality.
//    * @return whether the objects are equal.
//    */
//   public static boolean equals(Object obj1, Object obj2) {
//     try {
//       return obj1 == obj2 || (obj1 != null && obj1.equals(obj2));
//     } catch (Exception e) {
//       return false;
//     }
//   }
// 
//   /**
//    * Gets the default equality comparer.
//    * 
//    * @return the default equality comparer.
//    */
//   @SuppressWarnings("unchecked")
//   public static <T> EqualityComparer<T> getDefaultComparer() {
//     return (EqualityComparer<T>) ObjectUtilities.defaultComparer;
//   }
// 
//   private ObjectUtilities() {
//   }
// }


import com.bindroid.utils.EqualityComparer;
import com.bindroid.utils.ObjectUtilities;

package com.bindroid.trackable;


/**
 * Implements a {@link Trackable} that stores a value. A TrackableField calls {@link #track()} when
 * {@link #get()} is called and {@link #updateTrackers()} when {@link #set(Object)} is called and
 * its value has changed. As a result, TrackableFields are ideal for implementing properties -- most
 * of the time, getters and setters can simply delegate directly to the TrackableField, and the
 * TrackableField replaces the field that would otherwise have been private on the object.
 * TrackableFields are rarely exposed as a part of a public API.
 * 
 * TrackableFields are meant to be as lightweight as possible in order to avoid overhead when using
 * them for all of the fields of an object. For this reason, if you wish to specify a custom
 * {@link EqualityComparer}, you should use a {@link ComparingTrackableField}, which has the extra
 * field (and thus extra overhead) to store the comparer.
 * 
 * @param <T>
 *          The type of the field.
 */
public class TrackableField<T> extends Trackable {
  protected T value;
  private static EqualityComparer<Object> comparer;

  static {

// Path: Bindroid/src/com/bindroid/utils/EqualityComparer.java
// public interface EqualityComparer<T> {
//   boolean equals(T obj1, T obj2);
// }
// 
// Path: Bindroid/src/com/bindroid/utils/ObjectUtilities.java
// public class ObjectUtilities {
//   private static EqualityComparer<Object> defaultComparer;
// 
//   static {
//     ObjectUtilities.defaultComparer = new EqualityComparer<Object>() {
//       @Override
//       public boolean equals(Object obj1, Object obj2) {
//         return ObjectUtilities.equals(obj1, obj2);
//       }
//     };
//   }
// 
//   /**
//    * Safely compares two objects for equality, even if the objects are null.
//    * 
//    * @param obj1
//    *          an object to check for equality.
//    * @param obj2
//    *          an object to check for equality.
//    * @return whether the objects are equal.
//    */
//   public static boolean equals(Object obj1, Object obj2) {
//     try {
//       return obj1 == obj2 || (obj1 != null && obj1.equals(obj2));
//     } catch (Exception e) {
//       return false;
//     }
//   }
// 
//   /**
//    * Gets the default equality comparer.
//    * 
//    * @return the default equality comparer.
//    */
//   @SuppressWarnings("unchecked")
//   public static <T> EqualityComparer<T> getDefaultComparer() {
//     return (EqualityComparer<T>) ObjectUtilities.defaultComparer;
//   }
// 
//   private ObjectUtilities() {
//   }
// }


// Path: Bindroid/src/com/bindroid/trackable/TrackableField.java
import com.bindroid.utils.EqualityComparer;
import com.bindroid.utils.ObjectUtilities;

package com.bindroid.trackable;


/**
 * Implements a {@link Trackable} that stores a value. A TrackableField calls {@link #track()} when
 * {@link #get()} is called and {@link #updateTrackers()} when {@link #set(Object)} is called and
 * its value has changed. As a result, TrackableFields are ideal for implementing properties -- most
 * of the time, getters and setters can simply delegate directly to the TrackableField, and the
 * TrackableField replaces the field that would otherwise have been private on the object.
 * TrackableFields are rarely exposed as a part of a public API.
 * 
 * TrackableFields are meant to be as lightweight as possible in order to avoid overhead when using
 * them for all of the fields of an object. For this reason, if you wish to specify a custom
 * {@link EqualityComparer}, you should use a {@link ComparingTrackableField}, which has the extra
 * field (and thus extra overhead) to store the comparer.
 * 
 * @param <T>
 *          The type of the field.
 */
public class TrackableField<T> extends Trackable {
  protected T value;
  private static EqualityComparer<Object> comparer;

  static {

    TrackableField.comparer = ObjectUtilities.getDefaultComparer();
