1 | <?php |
||
25 | class Database |
||
26 | { |
||
27 | /** |
||
28 | * @var Repository |
||
29 | */ |
||
30 | private $sourceRepository; |
||
31 | |||
32 | /** |
||
33 | * @param Repository $sourceRepository |
||
34 | */ |
||
35 | public function __construct(Repository $sourceRepository) |
||
39 | |||
40 | /** |
||
41 | * @return static |
||
42 | */ |
||
43 | public static function fromDisk() |
||
49 | |||
50 | /** |
||
51 | * @param Codepoint $codepoint |
||
52 | * @return CodepointAssigned |
||
53 | * @throws CharacterNotFoundException |
||
54 | * @throws InvalidArgumentException |
||
55 | * @throws OutOfRangeException |
||
56 | */ |
||
57 | public function getByCodepoint(Codepoint $codepoint) |
||
62 | |||
63 | /** |
||
64 | * @param Codepoint\Collection $codepoints |
||
65 | * @return Character\Collection|CodepointAssigned[] |
||
66 | */ |
||
67 | public function getByCodepoints(Codepoint\Collection $codepoints) |
||
72 | |||
73 | /** |
||
74 | * @param Codepoint $codepoint |
||
75 | * @return Character |
||
76 | * @throws CharacterNotFoundException |
||
77 | */ |
||
78 | public function getCharacterByCodepoint(Codepoint $codepoint) |
||
88 | |||
89 | /** |
||
90 | * @return Collection|CodepointAssigned[] |
||
91 | */ |
||
92 | public function all() |
||
97 | |||
98 | /** |
||
99 | * @return Collection|Character[] |
||
100 | */ |
||
101 | public function onlyCharacters() |
||
106 | |||
107 | /** |
||
108 | * @return Collection|NonCharacter[] |
||
109 | */ |
||
110 | public function onlyNonCharacters() |
||
115 | |||
116 | /** |
||
117 | * @return Collection|Surrogate[] |
||
118 | */ |
||
119 | public function onlySurrogates() |
||
124 | |||
125 | /** |
||
126 | * @param Block $block |
||
127 | * @throws Repository\BlockNotFoundException |
||
128 | * @return Codepoint\Range\Collection |
||
129 | */ |
||
130 | public function getCodepointsByBlock(Block $block) |
||
135 | |||
136 | /** |
||
137 | * @param Block $block |
||
138 | * @return Collection|CodepointAssigned[] |
||
139 | */ |
||
140 | public function getByBlock(Block $block) |
||
146 | |||
147 | /** |
||
148 | * @param GeneralCategory $category |
||
149 | * @throws Repository\BlockNotFoundException |
||
150 | * @return Codepoint\Range\Collection |
||
151 | */ |
||
152 | public function getCodepointsByCategory(GeneralCategory $category) |
||
157 | |||
158 | /** |
||
159 | * @param GeneralCategory $category |
||
160 | * @return Collection|CodepointAssigned[] |
||
161 | */ |
||
162 | public function getByCategory(GeneralCategory $category) |
||
168 | |||
169 | /** |
||
170 | * @param Script $script |
||
171 | * @throws Repository\BlockNotFoundException |
||
172 | * @return Codepoint\Range\Collection |
||
173 | */ |
||
174 | public function getCodepointsByScript(Script $script) |
||
179 | |||
180 | /** |
||
181 | * @param Script $script |
||
182 | * @return Collection|CodepointAssigned[] |
||
183 | */ |
||
184 | public function getByScript(Script $script) |
||
190 | |||
191 | /** |
||
192 | * @param Codepoint\Range\Collection $ranges |
||
193 | * @return CodepointAssigned[] |
||
194 | */ |
||
195 | private function getByCodepointRanges(Codepoint\Range\Collection $ranges) |
||
201 | |||
202 | /** |
||
203 | * @return int |
||
204 | */ |
||
205 | public function getSize() |
||
209 | |||
210 | /** |
||
211 | * @return Repository |
||
212 | */ |
||
213 | private static function createFileRepository() |
||
224 | } |