summaryrefslogtreecommitdiffstats
path: root/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
blob: 9a1749dc14da04eb88a4a410e81ba5704e9b98b8 (plain)
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
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the COPYING file, which can be found at the root of the source code       *
 * distribution tree, or in https://www.hdfgroup.org/licenses.               *
 * If you do not have access to either file, you may request a copy from     *
 * help@hdfgroup.org.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

package hdf.hdf5lib.structs;

import java.io.Serializable;

/**
 * Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx)
 *
 */
public class H5O_hdr_info_t implements Serializable {
    private static final long serialVersionUID = 7883826382952577189L;
    public int version;       /* Version number of header format in file */
    public int nmesgs;        /* Number of object header messages */
    public int nchunks;       /* Number of object header chunks */
    public int flags;         /* Object header status flags */
    public long space_total;  /* Total space for storing object header in file */
    public long space_meta;   /* Space within header for object header metadata information */
    public long space_mesg;   /* Space within header for actual message information */
    public long space_free;   /* Free space within object header */
    public long mesg_present; /* Flags to indicate presence of message type in header */
    public long mesg_shared;  /* Flags to indicate message type is shared in header */

    H5O_hdr_info_t (int version, int nmesgs, int nchunks, int flags,
        long space_total, long space_meta, long space_mesg, long space_free,
        long mesg_present, long mesg_shared)
    {
        this.version = version;
        this.nmesgs = nmesgs;
        this.nchunks = nchunks;
        this.flags = flags;
        this.space_total = space_total;
        this.space_meta = space_meta;
        this.space_mesg = space_mesg;
        this.space_free = space_free;
        this.mesg_present = mesg_present;
        this.mesg_shared = mesg_shared;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;

        if (!(o instanceof H5O_hdr_info_t))
            return false;

        H5O_hdr_info_t info = (H5O_hdr_info_t) o;

        if (this.version != info.version)
            return false;
        if (this.nmesgs != info.nmesgs)
            return false;
        if (this.nchunks != info.nchunks)
            return false;
        if (this.flags != info.flags)
            return false;
        if (this.space_total != info.space_total)
            return false;
        if (this.space_meta != info.space_meta)
            return false;
        if (this.space_mesg != info.space_mesg)
            return false;
        if (this.space_free != info.space_free)
            return false;
        if (this.mesg_present != info.mesg_present)
            return false;
        if (this.mesg_shared != info.mesg_shared)
            return false;

        return true;
    }
}