• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

chdemko / php-sorted-collections / 12390158994

18 Dec 2024 09:33AM UTC coverage: 100.0%. Remained the same
12390158994

push

github

chdemko
Fix style in benchmarks

754 of 754 relevant lines covered (100.0%)

113.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/SortedCollection/SortedMap.php
1
<?php
2

3
/**
4
 * chdemko\SortedCollection\SortedMap interface
5
 *
6
 * @author    Christophe Demko <chdemko@gmail.com>
7
 * @copyright Copyright (C) 2012-2024 Christophe Demko. All rights reserved.
8
 *
9
 * @license BSD 3-Clause License
10
 *
11
 * This file is part of the php-sorted-collections package https://github.com/chdemko/php-sorted-collections
12
 */
13

14
// Declare chdemko\SortedCollection namespace
15
namespace chdemko\SortedCollection;
16

17
/**
18
 * SortedMap
19
 *
20
 * @package    SortedCollection
21
 * @subpackage Map
22
 *
23
 * @since 1.0.0
24
 */
25
interface SortedMap extends SortedCollection
26
{
27
    /**
28
     * Get the first key or throw an exception if there is no element
29
     *
30
     * @return mixed The first key
31
     *
32
     * @throws OutOfBoundsException If there is no element
33
     *
34
     * @since 1.0.0
35
     */
36
    public function firstKey();
37

38
    /**
39
     * Get the last key or throw an exception if there is no element
40
     *
41
     * @return mixed The last key
42
     *
43
     * @throws OutOfBoundsException If there is no element
44
     *
45
     * @since 1.0.0
46
     */
47
    public function lastKey();
48

49
    /**
50
     * Returns the greatest key lesser than the given key or throw an exception if there is no such key
51
     *
52
     * @param mixed $key The searched key
53
     *
54
     * @return mixed The found key
55
     *
56
     * @throws OutOfBoundsException If there is no lower element
57
     *
58
     * @since 1.0.0
59
     */
60
    public function lowerKey($key);
61

62
    /**
63
     * Returns the greatest key lesser than or equal to the given key or throw an exception if there is no such key
64
     *
65
     * @param mixed $key The searched key
66
     *
67
     * @return mixed The found key
68
     *
69
     * @throws OutOfBoundsException If there is no floor element
70
     *
71
     * @since 1.0.0
72
     */
73
    public function floorKey($key);
74

75
    /**
76
     * Returns the key equal to the given key or throw an exception if there is no such key
77
     *
78
     * @param mixed $key The searched key
79
     *
80
     * @return mixed The found key
81
     *
82
     * @throws OutOfBoundsException If there is no such element
83
     *
84
     * @since 1.0.0
85
     */
86
    public function findKey($key);
87

88
    /**
89
     * Returns the lowest key greater than or equal to the given key or throw an exception if there is no such key
90
     *
91
     * @param mixed $key The searched key
92
     *
93
     * @return mixed The found key
94
     *
95
     * @throws OutOfBoundsException If there is no ceiling element
96
     *
97
     * @since 1.0.0
98
     */
99
    public function ceilingKey($key);
100

101
    /**
102
     * Returns the lowest key greater than to the given key or throw an exception if there is no such key
103
     *
104
     * @param mixed $key The searched key
105
     *
106
     * @return mixed The found key
107
     *
108
     * @throws OutOfBoundsException If there is no higher element
109
     *
110
     * @since 1.0.0
111
     */
112
    public function higherKey($key);
113

114
    /**
115
     * Get the predecessor node
116
     *
117
     * @param TreeNode $node A tree node member of the underlying TreeMap
118
     *
119
     * @return mixed The predecessor node
120
     *
121
     * @since 1.0.0
122
     */
123
    public function predecessor($node);
124

125
    /**
126
     * Get the successor node
127
     *
128
     * @param TreeNode $node A tree node member of the underlying TreeMap
129
     *
130
     * @return mixed The successor node
131
     *
132
     * @since 1.0.0
133
     */
134
    public function successor($node);
135

136
    /**
137
     * Keys generator
138
     *
139
     * @return mixed The keys generator
140
     *
141
     * @since 1.0.0
142
     */
143
    public function keys();
144

145
    /**
146
     * Values generator
147
     *
148
     * @return mixed The values generator
149
     *
150
     * @since 1.0.0
151
     */
152
    public function values();
153
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc