Javolution 6.0.0 java
UnmodifiableSortedMapImpl.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 UnmodifiableSortedMapImpl<K, V> extends UnmodifiableMapImpl<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  @Override
40  public K firstKey() {
41  return target().firstKey();
42  }
43 
44  @Override
45  public SortedMapService<K, V> headMap(K toKey) {
46  return new SubSortedMapImpl<K,V>(this, null, toKey);
47  }
48 
49  @Override
51  return new SubSortedMapImpl<K,V>(this, null, null).keySet();
52  }
53 
54  @Override
55  public K lastKey() {
56  return target().lastKey();
57  }
58 
59  @Override
60  public SortedMapService<K, V> subMap(K fromKey, K toKey) {
61  return new SubSortedMapImpl<K,V>(this, fromKey, toKey);
62  }
63 
64  @Override
65  public SortedMapService<K, V> tailMap(K fromKey) {
66  return new SubSortedMapImpl<K,V>(this, fromKey, null);
67  }
68 
69  @Override
71  return this;
72  }
73 
74 
75  @Override
77  return (SortedMapService<K,V>) super.target();
78  }
79 }
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.firstKey
K firstKey()
Definition: UnmodifiableSortedMapImpl.java:40
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.comparator
Comparator<? super K > comparator()
Definition: UnmodifiableSortedMapImpl.java:30
javolution
javolution.util.internal
javolution.util.service
Definition: BitSetService.java:9
javolution.util.service.SortedSetService
Definition: SortedSetService.java:19
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.UnmodifiableSortedMapImpl
UnmodifiableSortedMapImpl(SortedMapService< K, V > target)
Definition: UnmodifiableSortedMapImpl.java:25
javolution.util.service.SortedMapService
Definition: SortedMapService.java:21
javolution.util.internal.map.UnmodifiableMapImpl
Definition: UnmodifiableMapImpl.java:19
javolution.util.internal.map.sorted.SortedMapView.keySet
SortedSetService< K > keySet()
Definition: SortedMapView.java:130
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.serialVersionUID
static final long serialVersionUID
Definition: UnmodifiableSortedMapImpl.java:23
javolution.util.internal.map.sorted.SubSortedMapImpl
Definition: SubSortedMapImpl.java:20
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl
Definition: UnmodifiableSortedMapImpl.java:21
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.keySet
SortedSetService< K > keySet()
Definition: UnmodifiableSortedMapImpl.java:50
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.lastKey
K lastKey()
Definition: UnmodifiableSortedMapImpl.java:55
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.threadSafe
SortedMapService< K, V > threadSafe()
Definition: UnmodifiableSortedMapImpl.java:70
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.tailMap
SortedMapService< K, V > tailMap(K fromKey)
Definition: UnmodifiableSortedMapImpl.java:65
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.entrySet
SortedSetService< Map.Entry< K, V > > entrySet()
Definition: UnmodifiableSortedMapImpl.java:35
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.headMap
SortedMapService< K, V > headMap(K toKey)
Definition: UnmodifiableSortedMapImpl.java:45
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.subMap
SortedMapService< K, V > subMap(K fromKey, K toKey)
Definition: UnmodifiableSortedMapImpl.java:60
javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl.target
SortedMapService< K, V > target()
Definition: UnmodifiableSortedMapImpl.java:76
javolution.util
Definition: FastBitSet.java:9
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