Mercurial > projects > dwt-addons
annotate dwtx/jface/viewers/AcceptAllFilter.d @ 43:ea8ff534f622
Fix override and super aliases
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 11 Apr 2008 01:24:25 +0200 |
parents | b6c35faf97c8 |
children |
rev | line source |
---|---|
10 | 1 /******************************************************************************* |
2 * Copyright (c) 2004, 2005 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.viewers.AcceptAllFilter; | |
14 | |
15 import dwtx.jface.viewers.IFilter; | |
16 | |
17 import dwt.dwthelper.utils; | |
18 | |
19 | |
20 /** | |
21 * Filter that accepts everything. Available as a singleton since having | |
22 * more than one instance would be wasteful. | |
23 * | |
24 * @since 3.1 | |
25 */ | |
26 public final class AcceptAllFilter : IFilter { | |
27 | |
28 /** | |
29 * Returns the singleton instance of AcceptAllFilter | |
30 * | |
31 * @return the singleton instance of AcceptAllFilter | |
32 */ | |
33 public static IFilter getInstance() { | |
34 if( singleton is null ){ | |
35 synchronized{ | |
36 if( singleton is null ){ | |
37 singleton = new AcceptAllFilter(); | |
38 } | |
39 } | |
40 } | |
41 return singleton; | |
42 } | |
43 | |
44 /** | |
45 * The singleton instance | |
46 */ | |
47 private static IFilter singleton = null; | |
48 | |
49 /* (non-Javadoc) | |
50 * @see dwtx.jface.viewers.deferred.IFilter#select(java.lang.Object) | |
51 */ | |
52 public bool select(Object toTest) { | |
53 return true; | |
54 } | |
55 | |
56 /* (non-Javadoc) | |
57 * @see java.lang.Object#equals(java.lang.Object) | |
58 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
59 public override int opEquals(Object other) { |
10 | 60 return other is this || null !is cast(AcceptAllFilter)other ; |
61 } | |
62 | |
63 } |