FIndex.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. @class FImmutableSortedDictionary;
  18. @class FNamedNode;
  19. @protocol FNode;
  20. @protocol FIndex<NSObject, NSCopying>
  21. - (NSComparisonResult) compareKey:(NSString *)key1
  22. andNode:(id<FNode>)node1
  23. toOtherKey:(NSString *)key2
  24. andNode:(id<FNode>)node2;
  25. - (NSComparisonResult) compareKey:(NSString *)key1
  26. andNode:(id<FNode>)node1
  27. toOtherKey:(NSString *)key2
  28. andNode:(id<FNode>)node2
  29. reverse:(BOOL)reverse;
  30. - (NSComparisonResult) compareNamedNode:(FNamedNode *)namedNode1 toNamedNode:(FNamedNode *)namedNode2;
  31. - (BOOL) isDefinedOn:(id<FNode>)node;
  32. - (BOOL) indexedValueChangedBetween:(id<FNode>)oldNode and:(id<FNode>)newNode;
  33. - (FNamedNode*) minPost;
  34. - (FNamedNode*) maxPost;
  35. - (FNamedNode*) makePost:(id<FNode>)indexValue name:(NSString*)name;
  36. - (NSString*) queryDefinition;
  37. @end
  38. @interface FIndex : NSObject
  39. + (id<FIndex>)indexFromQueryDefinition:(NSString *)string;
  40. @end