From a8a8dfb90d6a51ae369c042c95162f45754c7c4b Mon Sep 17 00:00:00 2001 From: randomguy3 Date: Mon, 9 Jan 2012 11:00:50 +0000 Subject: Move tikzit into "trunk" directory git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@365 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64 --- tikzit/src/common/GraphElementProperty.h | 91 ++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 tikzit/src/common/GraphElementProperty.h (limited to 'tikzit/src/common/GraphElementProperty.h') diff --git a/tikzit/src/common/GraphElementProperty.h b/tikzit/src/common/GraphElementProperty.h new file mode 100644 index 0000000..e8fe2a2 --- /dev/null +++ b/tikzit/src/common/GraphElementProperty.h @@ -0,0 +1,91 @@ +// +// GraphElementProperty.h +// TikZiT +// +// Copyright 2010 Aleks Kissinger. All rights reserved. +// +// +// This file is part of TikZiT. +// +// TikZiT is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// TikZiT is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with TikZiT. If not, see . +// + +#import + +/*! + @class GraphElementProperty + @brief A property. I.e. a single entry in a node's/edge's/graph's + GraphElementData table. + */ +@interface GraphElementProperty : NSObject { + NSString *key; + NSString *value; + BOOL isAtom; + BOOL isKeyMatch; +} + +@property (readwrite,retain) NSString *key; +@property (readwrite,retain) NSString *value; +@property (readonly) BOOL isAtom; +@property (readonly) BOOL isKeyMatch; + +/*! + @brief Initialize a new key-matching object. + @param k a key to match + @result A key-matching object. + */ +- (id)initWithKeyMatching:(NSString*)k; + +/*! + @brief Initialize a new atomic property. + @param n the atom's name + @result An atom. + */ +- (id)initWithAtomName:(NSString*)n; + +/*! + @brief Initialize a new property. + @param v the property's value + @param k the associated key + @result A property. + */ +- (id)initWithPropertyValue:(NSString*)v forKey:(NSString*)k; + +/*! + @brief A matching function for properties. + @details Two properties match iff their keys match and one of the following: + (a) they are both atomic, (b) one is a key-matching and one is a non-atomic + property, or (c) they are both non-atomic and their values match. + @param object another GraphElementProperty + @result A boolean. + */ +- (BOOL)matches:(GraphElementProperty*)object; + +/*! + @brief An alias for matches:. This allows one to use built-in methods that + filter on isEqual: for NSObjects. + @param object another GraphElementProperty + @result A boolean. + */ +- (BOOL)isEqual:(id)object; + +/*! + @brief Make a deep copy of this property. + @result A new property. + */ +- (id)copy; + +@end + +// vi:ft=objc:noet:ts=4:sts=4:sw=4 -- cgit v1.2.3