KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > util > SameObjectEqualityComparator


1 /**
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.util;
5
6 /**
7  * An {@link EqualityComparator}that tells if objects are the same actual object.
8  */

9 public class SameObjectEqualityComparator implements EqualityComparator {
10
11   public static final SameObjectEqualityComparator INSTANCE = new SameObjectEqualityComparator();
12
13   private SameObjectEqualityComparator() {
14     // Use INSTANCE instead.
15
}
16
17   public boolean isEquals(Object JavaDoc one, Object JavaDoc two) {
18     return one == two;
19   }
20
21 }
Popular Tags