Javolution 6.0.0 java
AtomicSortedMapImpl.java
Go to the documentation of this file.
1 /*
2  * Javolution - Java(TM) Solution for Real-Time and Embedded Systems
3  * Copyright (C) 2012 - Javolution (http://javolution.org/)
4  * All rights reserved.
5  *
6  * Permission to use, copy, modify, and distribute this software is
7  * freely granted, provided that this notice is preserved.
8  */
9 package javolution.util.internal.map.sorted;
10 
11 import java.util.Comparator;
12 import java.util.Map;
13 
17 
21 public class AtomicSortedMapImpl<K, V> extends AtomicMapImpl<K, V> implements SortedMapService<K,V> {
22 
23  private static final long serialVersionUID = 0x600L; // Version.
24 
26  super(target);
27  }
28 
29  @Override
30  public Comparator<? super K> comparator() {
31  return target().keyComparator();
32  }
33 
34  @Override
35  public SortedSetService<Map.Entry<K, V>> entrySet() {
36  return new SubSortedMapImpl<K,V>(this, null, null).entrySet();
37  }
38 
39 
40  @Override
41  public K firstKey() {
42  return targetView().firstKey();
43  }
44 
45 
46  @Override
47  public SortedMapService<K, V> headMap(K toKey) {
48  return new SubSortedMapImpl<K,V>(this, null, toKey);
49  }
50 
51  @Override
53  return new SubSortedMapImpl<K,V>(this, null, null).keySet();
54  }
55 
56  @Override
57  public K lastKey() {
58  return targetView().lastKey();
59  }
60 
61  @Override
62  public SortedMapService<K, V> subMap(K fromKey, K toKey) {
63  return new SubSortedMapImpl<K,V>(this, fromKey, toKey);
64  }
65 
66  @Override
67  public SortedMapService<K, V> tailMap(K fromKey) {
68  return new SubSortedMapImpl<K,V>(this, fromKey, null);
69  }
70 
71  @Override
73  return this;
74  }
75 
76  @Override
78  return (SortedMapService<K,V>) super.targetView();
79  }
80 
81 }
javolution.util.internal.map.sorted.AtomicSortedMapImpl.lastKey
K lastKey()
Definition: AtomicSortedMapImpl.java:57
javolution
javolution.util.internal
javolution.util.service
Definition: BitSetService.java:9
javolution.util.internal.map.sorted.AtomicSortedMapImpl.AtomicSortedMapImpl
AtomicSortedMapImpl(SortedMapService< K, V > target)
Definition: AtomicSortedMapImpl.java:25
javolution.util.internal.map.sorted.AtomicSortedMapImpl.threadSafe
SortedMapService< K, V > threadSafe()
Definition: AtomicSortedMapImpl.java:72
javolution.util.service.SortedSetService
Definition: SortedSetService.java:19
javolution.util.internal.map.sorted.AtomicSortedMapImpl.keySet
SortedSetService< K > keySet()
Definition: AtomicSortedMapImpl.java:52
javolution.util.internal.map.sorted.AtomicSortedMapImpl.entrySet
SortedSetService< Map.Entry< K, V > > entrySet()
Definition: AtomicSortedMapImpl.java:35
javolution.util.internal.map.sorted.AtomicSortedMapImpl.firstKey
K firstKey()
Definition: AtomicSortedMapImpl.java:41
javolution.util.service.SortedMapService
Definition: SortedMapService.java:21
javolution.util.internal.map.AtomicMapImpl
Definition: AtomicMapImpl.java:21
javolution.util.internal.map.sorted.SortedMapView.keySet
SortedSetService< K > keySet()
Definition: SortedMapView.java:130
javolution.util.internal.map.sorted.SubSortedMapImpl
Definition: SubSortedMapImpl.java:20
javolution.util.internal.map.sorted.AtomicSortedMapImpl.comparator
Comparator<? super K > comparator()
Definition: AtomicSortedMapImpl.java:30
javolution.util.internal.map.sorted.AtomicSortedMapImpl.tailMap
SortedMapService< K, V > tailMap(K fromKey)
Definition: AtomicSortedMapImpl.java:67
javolution.util.internal.map.sorted.AtomicSortedMapImpl.targetView
SortedMapService< K, V > targetView()
Definition: AtomicSortedMapImpl.java:77
javolution.util.internal.map.sorted.AtomicSortedMapImpl.subMap
SortedMapService< K, V > subMap(K fromKey, K toKey)
Definition: AtomicSortedMapImpl.java:62
javolution.util.internal.map.sorted.AtomicSortedMapImpl.serialVersionUID
static final long serialVersionUID
Definition: AtomicSortedMapImpl.java:23
javolution.util
Definition: FastBitSet.java:9
javolution.util.internal.map.sorted.AtomicSortedMapImpl.headMap
SortedMapService< K, V > headMap(K toKey)
Definition: AtomicSortedMapImpl.java:47
javolution.util.internal.map
Definition: AtomicMapImpl.java:9
javolution.util.internal.map.sorted.SortedMapView.entrySet
SortedSetService< Map.Entry< K, V > > entrySet()
Definition: SortedMapView.java:117
javolution.util.internal.map.MapView.target
MapService< K, V > target
Definition: MapView.java:213
javolution.util.internal.map.sorted.AtomicSortedMapImpl
Definition: AtomicSortedMapImpl.java:21