FSTArraySortedDictionary.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #import <Foundation/Foundation.h>
  2. #import "Firestore/third_party/Immutable/FSTImmutableSortedDictionary.h"
  3. NS_ASSUME_NONNULL_BEGIN
  4. /**
  5. * FSTArraySortedDictionary is an array backed implementation of FSTImmutableSortedDictionary.
  6. *
  7. * You should not use this class directly. You should use FSTImmutableSortedDictionary.
  8. *
  9. * FSTArraySortedDictionary uses arrays and linear lookups to achieve good memory efficiency while
  10. * maintaining good performance for small collections. It also uses fewer allocations than a
  11. * comparable red black tree. To avoid degrading performance with increasing collection size it
  12. * will automatically convert to a FSTTreeSortedDictionary after an insert call above a certain
  13. * threshold.
  14. */
  15. @interface FSTArraySortedDictionary <KeyType, ValueType> :
  16. FSTImmutableSortedDictionary<KeyType, ValueType>
  17. + (FSTArraySortedDictionary<KeyType, ValueType> *)
  18. dictionaryWithDictionary:(NSDictionary<KeyType, ValueType> *)dictionary
  19. comparator:(NSComparator)comparator;
  20. - (id)init __attribute__((unavailable("Use initWithComparator:keys:values: instead.")));
  21. - (instancetype)initWithComparator:(NSComparator)comparator;
  22. - (instancetype)initWithComparator:(NSComparator)comparator
  23. keys:(NSArray<KeyType> *)keys
  24. values:(NSArray<ValueType> *)values NS_DESIGNATED_INITIALIZER;
  25. @end
  26. NS_ASSUME_NONNULL_END