KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > prose > filter > ObjectEqualsToFilter


1 //
2
// This file is part of the prose package.
3
//
4
// The contents of this file are subject to the Mozilla Public License
5
// Version 1.1 (the "License"); you may not use this file except in
6
// compliance with the License. You may obtain a copy of the License at
7
// http://www.mozilla.org/MPL/
8
//
9
// Software distributed under the License is distributed on an "AS IS" basis,
10
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
// for the specific language governing rights and limitations under the
12
// License.
13
//
14
// The Original Code is prose.
15
//
16
// The Initial Developer of the Original Code is Andrei Popovici. Portions
17
// created by Andrei Popovici are Copyright (C) 2002 Andrei Popovici.
18
// All Rights Reserved.
19
//
20
// Contributor(s):
21
//$Id: ObjectEqualsToFilter.java,v 1.1.1.1 2003/07/02 15:30:52 apopovic Exp $
22
//=====================================================================
23
//
24
//(history at end)
25
//
26

27 package ch.ethz.prose.filter;
28 /*---------------------------------------------------------------------------*/
29   /* some concrete implementations */
30   /*---------------------------------------------------------------------------*/
31
32   /*-------------equal---------------------*/
33   class ObjectEqualsToFilter extends ObjectFilter
34   {
35     Object JavaDoc toBeComparedAgainst = null;
36     protected ObjectEqualsToFilter(int extrMethod, Object JavaDoc other)
37       {
38     // use extractor to get the target/this object
39
super(extrMethod);
40
41     // precondition
42
if (other == null)
43       throw new IllegalArgumentException JavaDoc("Target.equal(): null argument");
44
45     toBeComparedAgainst = other;
46
47       }
48
49     // the implementation of ObjectEquals
50
protected boolean doIsSpecialObject(Object JavaDoc target)
51       {
52     return toBeComparedAgainst.equals(target);
53       }
54   }
55
56
57 //====================================================================
58
//
59
//$Log: ObjectEqualsToFilter.java,v $
60
//Revision 1.1.1.1 2003/07/02 15:30:52 apopovic
61
//Imported from ETH Zurich
62
//
63
//Revision 1.2 2003/05/06 15:51:41 popovici
64
//Mozilla-ification
65
//
66
//Revision 1.1 2003/05/05 13:57:55 popovici
67
//renaming from runes to prose
68
//
69
//Revision 1.6 2003/04/17 14:46:03 popovici
70
//ThiS renamed to This; additional method renamings
71
//
72
//Revision 1.5 2003/04/17 12:49:34 popovici
73
//Refactoring of the crosscut package
74
// ExceptionCut renamed to ThrowCut
75
// McutSignature is now SignaturePattern
76
//
77
//Revision 1.4 2003/04/17 08:47:51 popovici
78
//Important functionality additions
79
// - Cflow specializers
80
// - Restructuring of the MethodCut, SetCut, ThrowCut, and GetCut (they are much smaller)
81
// - Transactional capabilities
82
// - Total refactoring of Specializer evaluation, which permits fine-grained distinction
83
// between static and dynamic specializers.
84
// - Functionality pulled up in abstract classes
85
// - Uniformization of advice methods patterns and names
86
//
87
//Revision 1.3 2003/03/05 10:48:51 popovici
88
//Adapted tot the IKS template form
89
//
90
//
91
Popular Tags