FIndex.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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
  31. toNamedNode:(FNamedNode *)namedNode2;
  32. - (BOOL)isDefinedOn:(id<FNode>)node;
  33. - (BOOL)indexedValueChangedBetween:(id<FNode>)oldNode and:(id<FNode>)newNode;
  34. - (FNamedNode *)minPost;
  35. - (FNamedNode *)maxPost;
  36. - (FNamedNode *)makePost:(id<FNode>)indexValue name:(NSString *)name;
  37. - (NSString *)queryDefinition;
  38. @end
  39. @interface FIndex : NSObject
  40. + (id<FIndex>)indexFromQueryDefinition:(NSString *)string;
  41. @end