2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include "EOQualifier.h"
26 @implementation EOQualifierVariable
28 + (id)variableWithKey:(NSString *)_key {
29 return [[[self alloc] initWithKey:_key] autorelease];
32 - (id)initWithKey:(NSString *)_key {
33 self->varKey = [_key copyWithZone:[self zone]];
37 return [self initWithKey:nil];
41 [self->varKey release];
53 - (void)encodeWithCoder:(NSCoder *)_coder {
54 [_coder encodeObject:self->varKey];
56 - (id)initWithCoder:(NSCoder *)_coder {
57 self->varKey = [[_coder decodeObject] copyWithZone:[self zone]];
63 - (BOOL)isEqual:(id)_obj {
64 if ([_obj isKindOfClass:[self class]])
65 return [self isEqualToQualifierVariable:(EOQualifierVariable *)_obj];
70 - (BOOL)isEqualToQualifierVariable:(EOQualifierVariable *)_obj {
71 return [self->varKey isEqual:[_obj key]];
76 - (NSString *)qualifierDescription {
77 return [@"$" stringByAppendingString:[self key]];
80 - (NSString *)description {
81 return [NSString stringWithFormat:@"<%@[0x%08X]: variable=%@>",
82 NSStringFromClass([self class]), self,
86 @end /* EOQualifierVariable */