1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752
|
/*
* Copyright 2007 - 2018 ETH Zuerich, CISD and SIS.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.hdf5;
import java.util.List;
import hdf.hdf5lib.exceptions.HDF5JavaException;
import ch.systemsx.cisd.base.mdarray.MDAbstractArray;
import ch.systemsx.cisd.hdf5.HDF5DataTypeInformation.DataTypeInfoOptions;
/**
* An interface to get information on HDF5 compound data sets and compound data types, and to create
* compound types from mappings to Java classes.
* <p>
* Obtain an object implementing this interface by calling {@link IHDF5Reader#compound()}.
* <p>
* <h2>What is an {@link HDF5CompoundType}?</h2>
* <p>
* A {@link HDF5CompoundType} is a Java object representing both an HDF5 compound type in a
* particular HDF5 file and the mapping of this HDF5 compound type to a representation in Java. A
* Java representation can be either a plain-old Java object (POJO) where Java fields correspond to
* HDF5 compound members, a map (see {@link HDF5CompoundDataMap}) where each HDF5 compound member is
* represented by one key-value pair, a list (see {@link HDF5CompoundDataList}) or
* <code>Object[]</code>, where the members of the HDF5 compound type are stored by their position
* (or order) in the HDF5 compound type.
* <p>
* It is important to understand that creating the HDF5 compound type in memory (what members of what types
* it contains in what order) and mapping the members to Java (including the Java type and, for POJOs, the
* field) are two distinct steps. Different methods of this interface use two different approaches on how
* to create the HDF5 compound type: <code>getType()</code> and <code>getInferredType()</code> create them
* anew, based on the POJO class and the <code>HDF5CompoundMemberMapping</code>s provided, while
* <code>getNamedType()</code>, <code>getDataSetType()</code> and <code>getAttributeType()</code> read them
* from the HDF5 file. Whenever you are reading a compound from an HDF5 file, the second approach should be
* preferred as the HDF5 file is the authorative source of information on HDF5 types.
* <p>
* The following Java types can be mapped to compound members:
* <ul>
* <li>Primitive values</li>
* <li>Primitive arrays</li>
* <li>Primitive matrices (except <code>char[][]</code>)</li>
* <li>{@link String} (fixed-length and variable-lengt)</li>
* <li>{@link java.util.BitSet}</li>
* <li>{@link java.util.Date}</li>
* <li>{@link HDF5EnumerationValue}</li>
* <li>{@link HDF5EnumerationValueArray}</li>
* <li>Sub-classes of {@link MDAbstractArray}</li>
* <li>References to data sets</li>
* </ul>
*
* @author Bernd Rinn
*/
public interface IHDF5CompoundInformationRetriever
{
/**
* An interface for inspecting the byte array of compounds and compound arrays just after they
* are read from or before they are written to the HDF5 file.
*/
public interface IByteArrayInspector
{
/**
* Called with the byte array. The method can change the <var>byteArray</var> but does so on
* its own risk!
*/
void inspect(byte[] byteArray);
}
// /////////////////////
// Information
// /////////////////////
/**
* Returns the member information for the committed compound data type <var>compoundClass</var>
* (using its "simple name") in the order that the members appear in the compound type. It is a
* failure condition if this compound data type does not exist.
*/
public <T> HDF5CompoundMemberInformation[] getMemberInfo(Class<T> compoundClass);
/**
* Returns the member information for the committed compound data type <var>dataTypeName</var>
* in the order that the members appear in the compound type. It is a failure condition if this
* compound data type does not exist. If the <var>dataTypeName</var> starts with '/', it will be
* considered a data type path instead of a data type name.
*
* @param dataTypeName The name of the compound data type to get the member information for.
*/
public HDF5CompoundMemberInformation[] getMemberInfo(String dataTypeName);
/**
* Returns the member information for the committed compound data type <var>dataTypeName</var>
* in the order that the members appear in the compound type. It is a failure condition if this
* compound data type does not exist. If the <var>dataTypeName</var> starts with '/', it will be
* considered a data type path instead of a data type name.
*
* @param dataTypeName The name of the compound data type to get the member information for.
* @param dataTypeInfoOptions The options on which information to get about the member data
* types.
*/
public HDF5CompoundMemberInformation[] getMemberInfo(String dataTypeName,
DataTypeInfoOptions dataTypeInfoOptions);
/**
* Returns the compound member information for the data set <var>dataSetPath</var> in the order
* that the members appear in the compound type. It is a failure condition if this data set does
* not exist or is not of compound type.
* <p>
* Call <code>Arrays.sort(compoundInformation)</code> to sort the array in alphabetical order of
* names.
*
* @throws HDF5JavaException If the data set is not of type compound.
*/
public HDF5CompoundMemberInformation[] getDataSetInfo(String dataSetPath)
throws HDF5JavaException;
/**
* Returns the compound member information for the data set <var>dataSetPath</var> in the order
* that the members appear in the compound type. It is a failure condition if this data set does
* not exist or is not of compound type.
* <p>
* Call <code>Arrays.sort(compoundInformation)</code> to sort the array in alphabetical order of
* names.
*
* @param dataSetPath The name of the data set to get the member information for.
* @param dataTypeInfoOptions The options on which information to get about the member data
* types.
* @throws HDF5JavaException If the data set is not of type compound.
*/
public HDF5CompoundMemberInformation[] getDataSetInfo(String dataSetPath,
DataTypeInfoOptions dataTypeInfoOptions) throws HDF5JavaException;
// /////////////////////
// Types
// /////////////////////
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>pojoClass</var>. The mapping is defined by <var>members</var>.
*
* @param name The name of the compound in the HDF5 file.
* @param pojoClass The plain old Java type that corresponds to this HDF5 type.
* @param requireTypesToBeEqual If <code>true</code>, this type is required to be equal to the
* type it tries to read, or else an {@link HDF5JavaException} will be thrown.
* @param members The mapping from the Java compound type to the HDF5 type.
*/
public <T> HDF5CompoundType<T> getType(String name, Class<T> pojoClass,
boolean requireTypesToBeEqual, HDF5CompoundMemberMapping... members);
/**
* Returns the compound type <var>name></var> for this HDF5 file.
*
* @param name The name of the compound in the HDF5 file.
* @param pojoClass The plain old Java type that corresponds to this HDF5 type.
* @param members The mapping from the Java compound type to the HDF5 type.
*/
public <T> HDF5CompoundType<T> getType(String name, Class<T> pojoClass,
HDF5CompoundMemberMapping... members);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>pojoClass</var>. The name of the compound data type is chosen to be the simple name of
* <var>pojoClass</var>. The mapping is defined by <var>members</var>.
*
* @param pojoClass The plain old Java type that corresponds to this HDF5 type.
* @param members The mapping from the Java compound type to the HDF5 type.
*/
public <T> HDF5CompoundType<T> getType(Class<T> pojoClass, HDF5CompoundMemberMapping... members);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>pojoClass</var>. The mapping of the Java compound type to the HDF5 type is inferred by
* reflection from <var>pojoClass</var> following basic rules on how Java data types are mapped
* to HDF5 data types.
*
* @param name The name of the compound in the HDF5 file.
* @param pojoClass The plain old Java type that corresponds to this HDF5 type.
* @param hints The hints to provide to the mapping procedure.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(String name, Class<T> pojoClass,
HDF5CompoundMappingHints hints);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>pojoClass</var>. The mapping of the Java compound type to the HDF5 type is inferred by
* reflection from <var>pojoClass</var> following basic rules on how Java data types are mapped
* to HDF5 data types.
*
* @param name The name of the compound in the HDF5 file.
* @param pojoClass The plain old Java type that corresponds to this HDF5 type.
* @param hints The hints to provide to the mapping procedure.
* @param requireTypesToBeEqual If <code>true</code>, this type is required to be equal to the
* type it tries to read, or else an {@link HDF5JavaException} will be thrown.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(String name, Class<T> pojoClass,
HDF5CompoundMappingHints hints, boolean requireTypesToBeEqual);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>pojoClass</var>. The mapping of the Java compound type to the HDF5 type is inferred by
* reflection from <var>pojoClass</var> following basic rules on how Java data types are mapped
* to HDF5 data types.
*
* @param name The name of the compound in the HDF5 file.
* @param pojoClass The plain old Java type that corresponds to this HDF5 type.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(String name, Class<T> pojoClass);
/**
* Returns a compound type for this HDF5 file, compatible with <var>pojoClass</var>. The mapping
* of the Java compound type to the HDF5 type is inferred by reflection from
* <var>pojoClass</var> following basic rules on how Java data types are mapped to HDF5 data
* types. As name of the HDF5 compound type, the simple name of <var>pojoClass</var> is chosen.
*
* @param pojoClass The plain old Java type that corresponds to this HDF5 type.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(Class<T> pojoClass);
/**
* Returns a compound type for this HDF5 file, compatible with <var>pojoClass</var>. The mapping
* of the Java compound type to the HDF5 type is inferred by reflection from
* <var>pojoClass</var> following basic rules on how Java data types are mapped to HDF5 data
* types. As name of the HDF5 compound type, the simple name of <var>pojoClass</var> is chosen.
*
* @param pojoClass The plain old Java type that corresponds to this HDF5 type.
* @param hints The hints to provide to the mapping procedure.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(Class<T> pojoClass,
HDF5CompoundMappingHints hints);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var>. The mapping of the Java compound type to the HDF5 type is inferred by
* reflection from <var>template</var> following basic rules on how Java data types are mapped
* to HDF5 data types.
*
* @param name The name of the compound type in the HDF5 file.
* @param template The compound to infer the HDF5 compound type from.
* @param hints The hints to provide to the mapping procedure.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(String name, T template,
HDF5CompoundMappingHints hints);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var>. The mapping of the Java compound type to the HDF5 type is inferred by
* reflection from <var>template</var> following basic rules on how Java data types are mapped
* to HDF5 data types.
*
* @param name The name of the compound type in the HDF5 file.
* @param template The compound to infer the HDF5 compound type from.
* @param hints The hints to provide to the mapping procedure.
* @param requireTypesToBeEqual If <code>true</code>, this type is required to be equal to the
* type it tries to read, or else an {@link HDF5JavaException} will be thrown.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(String name, T template,
HDF5CompoundMappingHints hints, boolean requireTypesToBeEqual);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var>. The mapping of the Java compound type to the HDF5 type is inferred by
* reflection from <var>template</var> following basic rules on how Java data types are mapped
* to HDF5 data types.
*
* @param name The name of the compound type in the HDF5 file.
* @param template The compound to infer the HDF5 compound type from.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(String name, T template);
/**
* Returns a compound type for this HDF5 file, compatible with <var>template</var>. The mapping
* of the Java compound type to the HDF5 type is inferred by reflection from <var>template</var>
* following basic rules on how Java data types are mapped to HDF5 data types. As name of the
* HDF5 compound type, the simple name of the class of <var>template</var> is chosen.
*
* @param template The compound to infer the HDF5 compound type from.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(T template);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var>. The mapping of the Java compound type to the HDF5 type is inferred by
* reflection from <var>template</var> following basic rules on how Java data types are mapped
* to HDF5 data types.
*
* @param name The name of the compound type in the HDF5 file.
* @param template The compound array to infer the HDF5 compound type from.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(final String name, final T[] template);
/**
* Returns a compound type for this HDF5 file, compatible with <var>template</var>. The mapping
* of the Java compound type to the HDF5 type is inferred by reflection from <var>template</var>
* following basic rules on how Java data types are mapped to HDF5 data types. As name of the
* HDF5 compound type, the simple name of the class of <var>template</var> is chosen.
*
* @param template The compound array to infer the HDF5 compound type from.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(final T[] template);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var>. The mapping of the Java compound type to the HDF5 type is inferred by
* reflection from <var>template</var> following basic rules on how Java data types are mapped
* to HDF5 data types.
*
* @param name The name of the compound type in the HDF5 file.
* @param template The compound array to infer the HDF5 compound type from.
* @param hints The hints to provide to the mapping procedure.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(String name, T[] template,
HDF5CompoundMappingHints hints);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var>. The mapping of the Java compound type to the HDF5 type is inferred by
* reflection from <var>template</var> following basic rules on how Java data types are mapped
* to HDF5 data types.
*
* @param name The name of the compound type in the HDF5 file.
* @param template The compound array to infer the HDF5 compound type from.
* @param hints The hints to provide to the mapping procedure.
* @param requireTypesToBeEqual If <code>true</code>, this type is required to be equal to the
* type it tries to read, or else an {@link HDF5JavaException} will be thrown.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public <T> HDF5CompoundType<T> getInferredType(String name, T[] template,
HDF5CompoundMappingHints hints, boolean requireTypesToBeEqual);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var> and <var>memberNames</var>. The mapping of the Java compound type to the
* HDF5 type is inferred by reflection of the elements of <var>template</var> following basic
* rules on how Java data types are mapped to HDF5 data types. Each element of
* <var>template</var> is considered a member of the compound. The names are taken from
* <var>memberNames</var> in the same order as in <var>template</var>.
*
* @param name The name of the compound type in the HDF5 file.
* @param memberNames The names of the members.
* @param template The compound to infer the HDF5 compound type from. Needs to have the same
* length as <var>memberNames</var>.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public HDF5CompoundType<List<?>> getInferredType(String name, List<String> memberNames,
List<?> template);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var> and <var>memberNames</var>. The mapping of the Java compound type to the
* HDF5 type is inferred by reflection of the elements of <var>template</var> following basic
* rules on how Java data types are mapped to HDF5 data types. Each element of
* <var>template</var> is considered a member of the compound. The names are taken from
* <var>memberNames</var> in the same order as in <var>template</var>.
*
* @param name The name of the compound type in the HDF5 file.
* @param memberNames The names of the members.
* @param template The compound to infer the HDF5 compound type from. Needs to have the same
* length as <var>memberNames</var>.
* @param hints The hints to provide to the mapping procedure.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public HDF5CompoundType<List<?>> getInferredType(String name, List<String> memberNames,
List<?> template, HDF5CompoundMappingHints hints);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var> and <var>memberNames</var>. The mapping of the Java compound type to the
* HDF5 type is inferred by reflection of the elements of <var>template</var> following basic
* rules on how Java data types are mapped to HDF5 data types. Each element of
* <var>template</var> is considered a member of the compound. The names are taken from
* <var>memberNames</var> in the same order as in <var>template</var>.
*
* @param name The name of the compound type in the HDF5 file.
* @param memberNames The names of the members.
* @param template The compound to infer the HDF5 compound type from. Needs to have the same
* length as <var>memberNames</var>.
* @param hints The hints to provide to the mapping procedure.
* @param requireTypesToBeEqual If <code>true</code>, this type is required to be equal to the
* type it tries to read, or else an {@link HDF5JavaException} will be thrown.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public HDF5CompoundType<List<?>> getInferredType(String name, List<String> memberNames,
List<?> template, HDF5CompoundMappingHints hints, boolean requireTypesToBeEqual);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var> and <var>memberNames</var>. The mapping of the Java compound type to the
* HDF5 type is inferred by reflection of the elements of <var>template</var> following basic
* rules on how Java data types are mapped to HDF5 data types. Each element of
* <var>template</var> is considered a member of the compound. The names are taken from
* <var>memberNames</var> in the same order as in <var>template</var>.
*
* @param memberNames The names of the members.
* @param template The compound to infer the HDF5 compound type from. Needs to have the same
* length as <var>memberNames</var>.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public HDF5CompoundType<List<?>> getInferredType(List<String> memberNames, List<?> template);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var> and <var>memberNames</var>. The mapping of the Java compound type to the
* HDF5 type is inferred by reflection of the elements of <var>template</var> following basic
* rules on how Java data types are mapped to HDF5 data types. Each element of
* <var>template</var> is considered a member of the compound. The names are taken from
* <var>memberNames</var> in the same order as in <var>template</var>.
*
* @param memberNames The names of the members.
* @param template The compound to infer the HDF5 compound type from. Needs to have the same
* length as <var>memberNames</var>.
* @param hints The hints to provide to the mapping procedure.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public HDF5CompoundType<List<?>> getInferredType(List<String> memberNames, List<?> template,
HDF5CompoundMappingHints hints);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var> and <var>memberNames</var>. The mapping of the Java compound type to the
* HDF5 type is inferred by reflection of the elements of <var>template</var> following basic
* rules on how Java data types are mapped to HDF5 data types. Each element of
* <var>template</var> is considered a member of the compound. The names are taken from
* <var>memberNames</var> in the same order as in <var>template</var>.
*
* @param name The name of the compound type in the HDF5 file.
* @param memberNames The names of the members.
* @param template The compound to infer the HDF5 compound type from. Needs to have the same
* length than <var>memberNames</var>.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public HDF5CompoundType<Object[]> getInferredType(String name, String[] memberNames,
Object[] template);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var> and <var>memberNames</var>. The mapping of the Java compound type to the
* HDF5 type is inferred by reflection of the elements of <var>template</var> following basic
* rules on how Java data types are mapped to HDF5 data types. Each element of
* <var>template</var> is considered a member of the compound. The names are taken from
* <var>memberNames</var> in the same order as in <var>template</var>.
*
* @param name The name of the compound type in the HDF5 file.
* @param memberNames The names of the members.
* @param template The compound to infer the HDF5 compound type from. Needs to have the same
* length than <var>memberNames</var>.
* @param hints The hints to provide to the mapping procedure.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public HDF5CompoundType<Object[]> getInferredType(String name, String[] memberNames,
Object[] template, HDF5CompoundMappingHints hints);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var> and <var>memberNames</var>. The mapping of the Java compound type to the
* HDF5 type is inferred by reflection of the elements of <var>template</var> following basic
* rules on how Java data types are mapped to HDF5 data types. Each element of
* <var>template</var> is considered a member of the compound. The names are taken from
* <var>memberNames</var> in the same order as in <var>template</var>.
*
* @param name The name of the compound type in the HDF5 file.
* @param memberNames The names of the members.
* @param template The compound to infer the HDF5 compound type from. Needs to have the same
* length than <var>memberNames</var>.
* @param hints The hints to provide to the mapping procedure.
* @param requireTypesToBeEqual If <code>true</code>, this type is required to be equal to the
* type it tries to read, or else an {@link HDF5JavaException} will be thrown.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public HDF5CompoundType<Object[]> getInferredType(String name, String[] memberNames,
Object[] template, HDF5CompoundMappingHints hints, boolean requireTypesToBeEqual);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var> and <var>memberNames</var>. The mapping of the Java compound type to the
* HDF5 type is inferred by reflection of the elements of <var>template</var> following basic
* rules on how Java data types are mapped to HDF5 data types. Each element of
* <var>template</var> is considered a member of the compound. The names are taken from
* <var>memberNames</var> in the same order as in <var>template</var>.
*
* @param memberNames The names of the members.
* @param template The compound to infer the HDF5 compound type from. Needs to have the same
* length than <var>memberNames</var>.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public HDF5CompoundType<Object[]> getInferredType(String[] memberNames, Object[] template);
/**
* Returns a compound type <var>name></var> for this HDF5 file, compatible with
* <var>template</var> and <var>memberNames</var>. The mapping of the Java compound type to the
* HDF5 type is inferred by reflection of the elements of <var>template</var> following basic
* rules on how Java data types are mapped to HDF5 data types. Each element of
* <var>template</var> is considered a member of the compound. The names are taken from
* <var>memberNames</var> in the same order as in <var>template</var>.
*
* @param memberNames The names of the members.
* @param template The compound to infer the HDF5 compound type from. Needs to have the same
* length than <var>memberNames</var>.
* @param hints The hints to provide to the mapping procedure.
* @see HDF5CompoundMemberMapping#inferMapping
*/
public HDF5CompoundType<Object[]> getInferredType(String[] memberNames, Object[] template,
HDF5CompoundMappingHints hints);
/**
* Returns the compound type for the given compound data set in <var>objectPath</var>, mapping
* it to <var>pojoClass</var>.
*
* @param objectPath The path of the compound dataset to get the type from.
* @param pojoClass The class to use for the mapping.
* @param requireTypesToBeEqual If <code>true</code>, this type is required to be equal to the
* type it tries to read, or else an {@link HDF5JavaException} will be thrown.
* @param members The mapping from the Java compound type to the HDF5 type.
* @return The compound data type.
*/
public <T> HDF5CompoundType<T> getDataSetType(String objectPath, Class<T> pojoClass,
boolean requireTypesToBeEqual, HDF5CompoundMemberMapping... members);
/**
* Returns the compound type for the given compound data set in <var>objectPath</var>, mapping
* it to <var>pojoClass</var>.
*
* @param objectPath The path of the compound dataset to get the type from.
* @param pojoClass The class to use for the mapping.
* @param members The mapping from the Java compound type to the HDF5 type.
* @return The compound data type.
*/
public <T> HDF5CompoundType<T> getDataSetType(String objectPath, Class<T> pojoClass,
HDF5CompoundMemberMapping... members);
/**
* Returns the compound type for the given compound data set in <var>objectPath</var>, mapping
* it to <var>pojoClass</var>.
*
* @param objectPath The path of the compound dataset to get the type from.
* @param pojoClass The class to use for the mapping.
* @param hints The hints to provide to the mapping procedure.
* @return The compound data type.
*/
public <T> HDF5CompoundType<T> getDataSetType(String objectPath, Class<T> pojoClass,
HDF5CompoundMappingHints hints);
/**
* Returns the compound type for the given compound data set in <var>objectPath</var>, mapping
* it to <var>pojoClass</var>.
*
* @param objectPath The path of the compound dataset to get the type from.
* @param pojoClass The class to use for the mapping.
* @param hints The hints to provide to the mapping procedure.
* @param requireTypesToBeEqual If <code>true</code>, this type is required to be equal to the
* type it tries to read, or else an {@link HDF5JavaException} will be thrown.
* @return The compound data type.
*/
public <T> HDF5CompoundType<T> getDataSetType(String objectPath, Class<T> pojoClass,
HDF5CompoundMappingHints hints, boolean requireTypesToBeEqual);
/**
* Returns the compound type for the given compound data set in <var>objectPath</var>, mapping
* it to <var>pojoClass</var>.
*
* @param objectPath The path of the compound dataset to get the type from.
* @param pojoClass The class to use for the mapping.
*/
public <T> HDF5CompoundType<T> getDataSetType(String objectPath, Class<T> pojoClass);
/**
* Returns the compound type for the given compound attribute in <var>attributeName</var> of
* <var>objectPath</var>, mapping it to <var>pojoClass</var>.
*
* @param objectPath The path of the compound dataset.
* @param attributeName The name of the attribute to get the type for.
* @param pojoClass The class to use for the mapping.
*/
public <T> HDF5CompoundType<T> getAttributeType(String objectPath, String attributeName,
Class<T> pojoClass);
/**
* Returns the compound type for the given compound attribute in <var>attributeName</var> of
* <var>objectPath</var>, mapping it to <var>pojoClass</var>.
*
* @param objectPath The path of the compound dataset.
* @param attributeName The name of the attribute to get the type for.
* @param pojoClass The class to use for the mapping.
* @param hints The hints to provide to the mapping procedure.
*/
public <T> HDF5CompoundType<T> getAttributeType(String objectPath, String attributeName,
Class<T> pojoClass, HDF5CompoundMappingHints hints);
/**
* Returns the compound type for the given compound attribute in <var>attributeName</var> of
* <var>objectPath</var>, mapping it to <var>pojoClass</var>.
*
* @param objectPath The path of the compound dataset.
* @param attributeName The name of the attribute to get the type for.
* @param pojoClass The class to use for the mapping.
* @param hints The hints to provide to the mapping procedure.
* @param dataTypeInfoOptions The options on which information to get about the member data
* types.
*/
public <T> HDF5CompoundType<T> getAttributeType(String objectPath, String attributeName,
Class<T> pojoClass, HDF5CompoundMappingHints hints,
DataTypeInfoOptions dataTypeInfoOptions);
/**
* Returns the compound type for the given compound attribute in <var>attributeName</var> of
* <var>objectPath</var>, mapping it to <var>pojoClass</var>.
*
* @param objectPath The path of the compound dataset.
* @param attributeName The name of the attribute to get the type for.
* @param pojoClass The class to use for the mapping.
* @param hints The hints to provide to the mapping procedure.
* @param dataTypeInfoOptions The options on which information to get about the member data
* types.
* @param requireTypesToBeEqual If <code>true</code>, this type is required to be equal to the
* type it tries to read, or else an {@link HDF5JavaException} will be thrown.
*/
public <T> HDF5CompoundType<T> getAttributeType(String objectPath, String attributeName,
Class<T> pojoClass, HDF5CompoundMappingHints hints,
DataTypeInfoOptions dataTypeInfoOptions, boolean requireTypesToBeEqual);
/**
* Returns the named compound type with name <var>dataTypeName</var> from file, mapping it to
* <var>pojoClass</var>. If the <var>dataTypeName</var> starts with '/', it will be considered a
* data type path instead of a data type name.
* <p>
* <em>Note:</em> This method only works for compound data types 'committed' to the HDF5 file.
* For files written with JHDF5 this will always be true, however, files created with other
* libraries may not choose to commit compound data types.
*
* @param dataTypeName The path to a committed data type, if starting with '/', or a name of a
* committed data type otherwise.
* @param pojoClass The class to use for the mapping.
* @return The compound data type.
*/
public <T> HDF5CompoundType<T> getNamedType(String dataTypeName, Class<T> pojoClass);
/**
* Returns the named compound type with name <var>dataTypeName</var> from file, mapping it to
* <var>pojoClass</var>. This method will use the default name for the compound data type as
* chosen by JHDF5 and thus will likely only work on files written with JHDF5. The default name
* is based on the simple name of <var>compoundType</var>.
*
* @param pojoClass The class to use for the mapping and to get the name of named data type
* from.
* @return The compound data type.
*/
public <T> HDF5CompoundType<T> getNamedType(Class<T> pojoClass);
/**
* Returns the named compound type with name <var>dataTypeName</var> from file, mapping it to
* <var>pojoClass</var>. If the <var>dataTypeName</var> starts with '/', it will be considered a
* data type path instead of a data type name.
* <p>
* <em>Note:</em> This method only works for compound data types 'committed' to the HDF5 file.
* For files written with JHDF5 this will always be true, however, files created with other
* libraries may not choose to commit compound data types.
*
* @param dataTypeName The path to a committed data type, if starting with '/', or a name of a
* committed data type otherwise.
* @param pojoClass The class to use for the mapping.
* @param hints The hints to provide to the mapping procedure.
* @return The compound data type.
*/
public <T> HDF5CompoundType<T> getNamedType(String dataTypeName, Class<T> pojoClass,
HDF5CompoundMappingHints hints);
/**
* Returns the named compound type with name <var>dataTypeName</var> from file, mapping it to
* <var>pojoClass</var>. If the <var>dataTypeName</var> starts with '/', it will be considered a
* data type path instead of a data type name.
* <p>
* <em>Note:</em> This method only works for compound data types 'committed' to the HDF5 file.
* For files written with JHDF5 this will always be true, however, files created with other
* libraries may not choose to commit compound data types.
*
* @param dataTypeName The path to a committed data type, if starting with '/', or a name of a
* committed data type otherwise.
* @param pojoClass The class to use for the mapping.
* @param dataTypeInfoOptions The options on which information to get about the member data
* types.
* @return The compound data type.
*/
public <T> HDF5CompoundType<T> getNamedType(String dataTypeName, Class<T> pojoClass,
DataTypeInfoOptions dataTypeInfoOptions);
/**
* Returns the named compound type with name <var>dataTypeName</var> from file, mapping it to
* <var>pojoClass</var>. If the <var>dataTypeName</var> starts with '/', it will be considered a
* data type path instead of a data type name.
* <p>
* <em>Note:</em> This method only works for compound data types 'committed' to the HDF5 file.
* For files written with JHDF5 this will always be true, however, files created with other
* libraries may not choose to commit compound data types.
*
* @param dataTypeName The path to a committed data type, if starting with '/', or a name of a
* committed data type otherwise.
* @param pojoClass The class to use for the mapping.
* @param hints The hints to provide to the mapping procedure.
* @param dataTypeInfoOptions The options on which information to get about the member data
* types.
* @return The compound data type.
*/
public <T> HDF5CompoundType<T> getNamedType(String dataTypeName, Class<T> pojoClass,
HDF5CompoundMappingHints hints, DataTypeInfoOptions dataTypeInfoOptions);
/**
* Returns the named compound type with name <var>dataTypeName</var> from file, mapping it to
* <var>pojoClass</var>. If the <var>dataTypeName</var> starts with '/', it will be considered a
* data type path instead of a data type name.
* <p>
* <em>Note:</em> This method only works for compound data types 'committed' to the HDF5 file.
* For files written with JHDF5 this will always be true, however, files created with other
* libraries may not choose to commit compound data types.
*
* @param dataTypeName The path to a committed data type, if starting with '/', or a name of a
* committed data type otherwise.
* @param pojoClass The class to use for the mapping.
* @param hints The hints to provide to the mapping procedure.
* @param dataTypeInfoOptions The options on which information to get about the member data
* types.
* @param requireTypesToBeEqual If <code>true</code>, this type is required to be equal to the
* type it tries to read, or else an {@link HDF5JavaException} will be thrown.
* @return The compound data type.
*/
public <T> HDF5CompoundType<T> getNamedType(String dataTypeName, Class<T> pojoClass,
HDF5CompoundMappingHints hints, DataTypeInfoOptions dataTypeInfoOptions,
boolean requireTypesToBeEqual);
}
|