Javolution 6.0.0 java
SharedSortedSetImpl.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.set.sorted;
10
11
import
javolution
.
util
.
internal
.
set
.
SharedSetImpl
;
12
import
javolution
.
util
.
service
.
SetService
;
13
import
javolution
.
util
.
service
.
SortedSetService
;
14
18
public
class
SharedSortedSetImpl
<E>
extends
SharedSetImpl
<E> implements
19
SortedSetService
<E> {
20
21
private
static
final
long
serialVersionUID
= 0x600L;
// Version.
22
23
public
SharedSortedSetImpl
(
SetService<E>
target
) {
24
super(
target
);
25
}
26
27
@Override
28
public
E
first
() {
29
lock
.
readLock
.
lock
();
30
try
{
31
return
target
().first();
32
}
finally
{
33
lock
.
readLock
.
unlock
();
34
}
35
}
36
37
@Override
38
public
SortedSetService<E>
headSet
(E toElement) {
39
return
new
SubSortedSetImpl<E>
(
this
,
null
, toElement);
40
}
41
42
@Override
43
public
E
last
() {
44
lock
.
readLock
.
lock
();
45
try
{
46
return
target
().last();
47
}
finally
{
48
lock
.
readLock
.
unlock
();
49
}
50
}
51
52
@Override
53
public
SortedSetService<E>
subSet
(E fromElement, E toElement) {
54
return
new
SubSortedSetImpl<E>
(
this
, fromElement, toElement);
55
}
56
57
@Override
58
public
SortedSetService<E>
tailSet
(E fromElement) {
59
return
new
SubSortedSetImpl<E>
(
this
, fromElement,
null
);
60
}
61
62
@Override
63
public
SortedSetService<E>
threadSafe
() {
64
return
this
;
65
}
66
67
@Override
68
protected
SortedSetService<E>
target
() {
69
return
(
SortedSetService<E>
) super.target();
70
}
71
}
javolution
javolution.util.internal
javolution.util.service
Definition:
BitSetService.java:9
javolution.util.internal.set.SharedSetImpl
Definition:
SharedSetImpl.java:18
javolution.util.internal.set.sorted.SharedSortedSetImpl.tailSet
SortedSetService< E > tailSet(E fromElement)
Definition:
SharedSortedSetImpl.java:58
javolution.util.service.SortedSetService
Definition:
SortedSetService.java:19
javolution.util.internal.set.sorted.SubSortedSetImpl
Definition:
SubSortedSetImpl.java:20
javolution.util.internal.set
Definition:
AtomicSetImpl.java:9
javolution.util.internal.collection.ReadWriteLockImpl.readLock
final ReadLock readLock
Definition:
ReadWriteLockImpl.java:123
javolution.util.internal.set.sorted.SharedSortedSetImpl.headSet
SortedSetService< E > headSet(E toElement)
Definition:
SharedSortedSetImpl.java:38
javolution.util.internal.set.sorted.SharedSortedSetImpl.last
E last()
Definition:
SharedSortedSetImpl.java:43
javolution.util.internal.set.sorted.SharedSortedSetImpl.target
SortedSetService< E > target()
Definition:
SharedSortedSetImpl.java:68
javolution.util.internal.collection.ReadWriteLockImpl.ReadLock.lock
void lock()
Definition:
ReadWriteLockImpl.java:30
javolution.util.internal.set.sorted.SharedSortedSetImpl
Definition:
SharedSortedSetImpl.java:19
javolution.util.internal.set.sorted.SharedSortedSetImpl.SharedSortedSetImpl
SharedSortedSetImpl(SetService< E > target)
Definition:
SharedSortedSetImpl.java:23
javolution.util.internal.collection.SharedCollectionImpl.lock
ReadWriteLockImpl lock
Definition:
SharedCollectionImpl.java:57
javolution.util.service.SetService
Definition:
SetService.java:19
javolution.util.internal.set.sorted.SharedSortedSetImpl.first
E first()
Definition:
SharedSortedSetImpl.java:28
javolution.util.internal.collection.ReadWriteLockImpl.ReadLock.unlock
void unlock()
Definition:
ReadWriteLockImpl.java:64
javolution.util.internal.set.sorted.SharedSortedSetImpl.subSet
SortedSetService< E > subSet(E fromElement, E toElement)
Definition:
SharedSortedSetImpl.java:53
javolution.util.internal.set.sorted.SharedSortedSetImpl.serialVersionUID
static final long serialVersionUID
Definition:
SharedSortedSetImpl.java:21
javolution.util
Definition:
FastBitSet.java:9
javolution.util.internal.set.sorted.SharedSortedSetImpl.threadSafe
SortedSetService< E > threadSafe()
Definition:
SharedSortedSetImpl.java:63
core-java
src
main
java
javolution
util
internal
set
sorted
SharedSortedSetImpl.java
Generated by
1.8.18