@@ -122,7 +122,7 @@ async def add_map_listener(
122
122
against the map, with the key, old-value and new-value included.
123
123
124
124
:param listener: the MapListener to register
125
- :param listener_for: the optional the key that identifies the entry for which to raise events or a Filter
125
+ :param listener_for: the optional key that identifies the entry for which to raise events or a Filter
126
126
that will be passed MapEvent objects to select from; a MapEvent will be delivered to the listener only if the
127
127
filter evaluates to `True` for that MapEvent. `None` is equivalent to a Filter that always returns `True`
128
128
:param lite: optionally pass `True` to indicate that the MapEvent objects do not have to include the
@@ -134,7 +134,7 @@ async def add_map_listener(
134
134
async def remove_map_listener (self , listener : MapListener [K , V ], listener_for : Optional [K | Filter ] = None ) -> None :
135
135
"""
136
136
Remove a standard map listener that previously registered to receive events.
137
- :param listener: the MapListener to removed
137
+ :param listener: the MapListener to be removed
138
138
:param listener_for: the key or filter, if any, passed to a previous addMapListener invocation
139
139
:raises ValueError: if `listener` is `None`
140
140
"""
@@ -179,7 +179,7 @@ async def get_or_default(self, key: K, default_value: Optional[V] = None) -> Opt
179
179
@abc .abstractmethod
180
180
async def get_all (self , keys : set [K ]) -> dict [K , V ]:
181
181
"""
182
- Get all the specified keys, if they are in the map. For each key that is in the map,
182
+ Get all the specified keys if they are in the map. For each key that is in the map,
183
183
that key and its corresponding value will be placed in the map that is returned by
184
184
this method. The absence of a key in the returned map indicates that it was not in the cache,
185
185
which may imply (for caches that can load behind the scenes) that the requested data
@@ -197,9 +197,9 @@ async def put(self, key: K, value: V) -> V:
197
197
198
198
:param key: the key with which the specified value is to be associated
199
199
:param value: the value to be associated with the specified key
200
- :return: the previous value associated with specified key, or `None`
200
+ :return: the previous value associated with the specified key, or `None`
201
201
if there was no mapping for key. A `None` return can also indicate
202
- that the map previously associated `None` with the specified key,
202
+ that the map previously associated `None` with the specified key
203
203
if the implementation supports `None` values
204
204
"""
205
205
@@ -211,8 +211,8 @@ async def put_if_absent(self, key: K, value: V) -> V:
211
211
212
212
:param key: the key with which the specified value is to be associated
213
213
:param value: the value to be associated with the specified key
214
- :return: the previous value associated with specified key, or `None` if there was no mapping for key. A
215
- `None` return can also indicate that the map previously associated `None` with the specified key,
214
+ :return: the previous value associated with the specified key, or `None` if there was no mapping for key. A
215
+ `None` return can also indicate that the map previously associated `None` with the specified key
216
216
if the implementation supports `None` values
217
217
218
218
"""
@@ -285,7 +285,7 @@ async def replace(self, key: K, value: V) -> V:
285
285
:param key: key whose associated value is to be replaced
286
286
:param value: value expected to be associated with the specified key
287
287
:return: resolving to the previous value associated with the specified key, or `None` if there was no mapping
288
- for the key. (A `None` return can also indicate that the map previously associated `None` with the key,
288
+ for the key. (A `None` return can also indicate that the map previously associated `None` with the key
289
289
if the implementation supports `None` values.)
290
290
"""
291
291
@@ -340,7 +340,7 @@ async def invoke(self, key: K, processor: EntryProcessor) -> R:
340
340
Invoke the passed EntryProcessor against the Entry specified by the
341
341
passed key, returning the result of the invocation.
342
342
343
- :param key: the key to process it is not required to exist within the Map
343
+ :param key: the key to process - it is not required to exist within the Map
344
344
:param processor: the EntryProcessor to use to process the specified key
345
345
:return: the result of the invocation as returned from the EntryProcessor
346
346
"""
@@ -377,22 +377,22 @@ async def aggregate(
377
377
378
378
:param aggregator: the EntryAggregator that is used to aggregate across the specified entries of this Map
379
379
:param keys: the Iterable of keys that specify the entries within this Map to aggregate across
380
- :param filter: the that is used to select entries within this Map to aggregate across
380
+ :param filter: the Filter that is used to select entries within this Map to aggregate across
381
381
:return: the result of the invocation as returned from the EntryProcessor
382
382
"""
383
383
384
384
@abc .abstractmethod
385
385
async def values (self , filter : Optional [Filter ] = None , comparator : Optional [Comparator ] = None ) -> set [V ]:
386
386
"""
387
387
Return a Set of the values contained in this map that satisfy the criteria expressed by the filter.
388
- If no filter or comparator is specified It returns a Set view of the values contained in this map.The
388
+ If no filter or comparator is specified, it returns a Set view of the values contained in this map.The
389
389
collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If
390
390
the map is modified while an iteration over the collection is in progress (except through the iterator's own
391
391
`remove` operation), the results of the iteration are undefined.
392
392
393
393
:param filter: the Filter object representing the criteria that the entries of this map should satisfy
394
394
:param comparator: the Comparator object which imposes an ordering on entries in the resulting set; or null
395
- if the entries values natural ordering should be used
395
+ if the entries' natural ordering should be used
396
396
:return: resolves to the values in the set that satisfy the specified criteria
397
397
"""
398
398
@@ -415,14 +415,14 @@ async def entries(self, filter: Optional[Filter] = None, comparator: Optional[Co
415
415
:param filter: the Filter object representing the criteria that the entries of this map should satisfy
416
416
:param comparator: the Comparator object which imposes an ordering on entries in the resulting set; or `None`
417
417
if the entries' values natural ordering should be used
418
- :return: a set of entries that satisfy the specif]ied criteria
418
+ :return: a set of entries that satisfy the specified criteria
419
419
"""
420
420
421
421
422
422
class NamedCache (NamedMap [K , V ]):
423
423
"""
424
424
A Map-based data-structure that manages entries across one or more processes. Entries are typically managed in
425
- memory, and are often comprised of data that is also stored in an external system, for example a database,
425
+ memory, and are often comprised of data that is also stored in an external system, for example, a database,
426
426
or data that has been assembled or calculated at some significant cost. Such entries are referred to as being
427
427
`cached`.
428
428
@@ -440,7 +440,7 @@ async def put(self, key: K, value: V, ttl: int = -1) -> V:
440
440
:param value: the value to be associated with the specified key
441
441
:param ttl: the expiry time in millis (optional)
442
442
:return: resolving to the previous value associated with specified key, or `None` if there was no mapping for
443
- key. A `None` return can also indicate that the map previously associated `None` with the specified key,
443
+ key. A `None` return can also indicate that the map previously associated `None` with the specified key
444
444
if the implementation supports `None` values
445
445
446
446
"""
@@ -455,7 +455,7 @@ async def put_if_absent(self, key: K, value: V, ttl: int = -1) -> V:
455
455
:param value: the value to be associated with the specified key
456
456
:param ttl: the expiry time in millis (optional)
457
457
:return: resolving to the previous value associated with specified key, or `None` if there was no mapping for
458
- key. A `None` return can also indicate that the map previously associated `None` with the specified key,
458
+ key. A `None` return can also indicate that the map previously associated `None` with the specified key
459
459
if the implementation supports `None` values
460
460
461
461
"""
0 commit comments