Home | History | Annotate | Download | only in clearsilver

Lines Matching defs:hdf

25  * Utility class that delegates all methods of an HDF object. Made to
26 * facilitate the transition to HDF being an interface and thus not
29 * This class, and its subclasses must take care to wrap or unwrap HDF and CS
32 public abstract class DelegatedHdf implements HDF {
34 private final HDF hdf;
36 public DelegatedHdf(HDF hdf) {
37 if (hdf == null) {
38 throw new NullPointerException("Null HDF is not allowed in constructor of DelegatedHdf.");
40 this.hdf = hdf;
45 * and get down to a concrete (or unknown) HDF object.
46 * @param hdf the possibly DelegatedHdf to unwrap
47 * @return the innermost non-DelegatedHdf HDF object.
49 public static HDF getFullyUnwrappedHdf(HDF hdf) {
50 while (hdf instanceof DelegatedHdf) {
51 hdf = ((DelegatedHdf)hdf).getHdf();
53 return hdf;
56 public HDF getHdf() {
57 return hdf;
62 * new DelegatedHdf object that wraps the specified HDF object.
64 * @param hdf an HDF object that should be wrapped in a new DelegatedHdf
67 * given HDF object.
69 protected abstract DelegatedHdf newDelegatedHdf(HDF hdf);
133 HDF hdf = getHdf().getObj(hdfpath);
134 return hdf != null ? newDelegatedHdf(hdf) : null;
138 HDF hdf = getHdf().getChild(hdfpath);
139 return hdf != null ? newDelegatedHdf(hdf) : null;
143 HDF hdf = getHdf().getRootObj();
144 return hdf != null ? newDelegatedHdf(hdf) : null;
147 public boolean belongsToSameRoot(HDF hdf) {
148 return getFullyUnwrappedHdf(this).belongsToSameRoot(getFullyUnwrappedHdf(hdf));
152 HDF hdf = getHdf().getOrCreateObj(hdfpath);
153 return hdf != null ? newDelegatedHdf(hdf) : null;
165 HDF hdf = getHdf().objChild();
166 return hdf != null ? newDelegatedHdf(hdf) : null;
170 HDF hdf = getHdf().objNext();
171 return hdf != null ? newDelegatedHdf(hdf) : null;
174 public void copy(String hdfpath, HDF src) {