/***************************************************************** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. ****************************************************************/ #import "CAYNodeDiff.h" @implementation CAYNodeDiff -(id)initWithNodeId:(id)nid { [super init]; [self setNodeId:nid]; return self; } -(id)initWithNodeId:(id)nid diffId:(NSInteger)did { [self initWithNodeId:nid]; diffId = did; return self; } -(id)initWithCoder:(NSCoder*)coder { [super init]; diffId = [coder decodeIntForKey:@"diffId"]; [self setNodeId:[coder decodeObjectForKey:@"nodeId"]]; return self; } -(void)encodeWithCoder:(NSCoder*)coder { [coder encodeInt:diffId forKey:@"diffId"]; [coder encodeObject:nodeId forKey:@"nodeId"]; } -(void)setNodeId:(NSObject *)nid { [nid retain]; [nodeId release]; nodeId = nid; } -(NSObject *)nodeId { return nodeId; } -(void)apply:(CAYObjectStore *)objectStore { NSLog(@"DEBUG: %@ does not implement apply:", [self class]); } -(void)undo:(CAYObjectStore *)objectStore { NSLog(@"DEBUG: %@ does not implement undo:", [self class]); } -(BOOL)isOpposite:(CAYNodeDiff *)diff { NSLog(@"DEBUG: %@ does not implement isOpposite:", [self class]); return NO; } -(void)dealloc { [self setNodeId:nil]; [super dealloc]; } @end