1 | <?php |
||
27 | class Database |
||
28 | { |
||
29 | /** |
||
30 | * @var Repository |
||
31 | */ |
||
32 | private $sourceRepository; |
||
33 | |||
34 | /** |
||
35 | * @param Repository $sourceRepository |
||
36 | */ |
||
37 | public function __construct(Repository $sourceRepository) |
||
41 | |||
42 | /** |
||
43 | * @return static |
||
44 | */ |
||
45 | public static function fromDisk() |
||
51 | |||
52 | /** |
||
53 | * @param Codepoint $codepoint |
||
54 | * @return CodepointAssigned |
||
55 | * @throws CharacterNotFoundException |
||
56 | * @throws InvalidArgumentException |
||
57 | * @throws OutOfRangeException |
||
58 | */ |
||
59 | public function getByCodepoint(Codepoint $codepoint) |
||
64 | |||
65 | /** |
||
66 | * @param Codepoint\Collection $codepoints |
||
67 | * @return Character\Collection|CodepointAssigned[] |
||
68 | */ |
||
69 | public function getByCodepoints(Codepoint\Collection $codepoints) |
||
74 | |||
75 | /** |
||
76 | * @param Codepoint $codepoint |
||
77 | * @return Character |
||
78 | * @throws CharacterNotFoundException |
||
79 | */ |
||
80 | public function getCharacterByCodepoint(Codepoint $codepoint) |
||
90 | |||
91 | /** |
||
92 | * @return Collection|CodepointAssigned[] |
||
93 | */ |
||
94 | public function all() |
||
99 | |||
100 | /** |
||
101 | * @return Collection|Character[] |
||
102 | */ |
||
103 | public function onlyCharacters() |
||
108 | |||
109 | /** |
||
110 | * @return Collection|NonCharacter[] |
||
111 | */ |
||
112 | public function onlyNonCharacters() |
||
117 | |||
118 | /** |
||
119 | * @return Collection|Surrogate[] |
||
120 | */ |
||
121 | public function onlySurrogates() |
||
126 | |||
127 | /** |
||
128 | * @param Block $block |
||
129 | * @throws Repository\BlockNotFoundException |
||
130 | * @return Codepoint\Range\Collection |
||
131 | */ |
||
132 | public function getCodepointsByBlock(Block $block) |
||
137 | |||
138 | /** |
||
139 | * @param Block $block |
||
140 | * @return Collection|CodepointAssigned[] |
||
141 | */ |
||
142 | public function getByBlock(Block $block) |
||
149 | |||
150 | /** |
||
151 | * @param GeneralCategory $category |
||
152 | * @throws Repository\BlockNotFoundException |
||
153 | * @return Codepoint\Range\Collection |
||
154 | */ |
||
155 | public function getCodepointsByCategory(GeneralCategory $category) |
||
160 | |||
161 | /** |
||
162 | * @param GeneralCategory $category |
||
163 | * @return Collection|CodepointAssigned[] |
||
164 | */ |
||
165 | public function getByCategory(GeneralCategory $category) |
||
172 | |||
173 | /** |
||
174 | * @return int |
||
175 | */ |
||
176 | public function getSize() |
||
180 | |||
181 | /** |
||
182 | * @return Repository |
||
183 | */ |
||
184 | private static function createFileRepository() |
||
197 | } |