public class JniHdf extends Object implements HDF
| Modifier | Constructor and Description |
|---|---|
|
JniHdf()
Default public constructor.
|
protected |
JniHdf(long hdfptr,
JniHdf parent) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
belongsToSameRoot(HDF hdf)
Checks if the given hdf object belongs to the same root HDF object
as this one.
|
void |
close()
Clean up allocated memory if neccesary.
|
void |
copy(String hdfpath,
HDF src)
Deep copy of the contents of the source HDF structure to this HDF
starting at the specified HDF path node.
|
String |
dump()
Generates a string representing the content of the HDF tree rooted at
this node.
|
void |
exportDate(String hdfname,
String tz,
int tt)
Export a date to a clearsilver tree using a specified timezone
|
void |
exportDate(String hdfname,
TimeZone timeZone,
Date date)
Export a date to a clearsilver tree using a specified timezone
|
protected String |
fileLoad(String filename) |
protected void |
finalize()
Call close() just in case when deallocating Java object.
|
JniHdf |
getChild(String hdfpath)
Retrieves the HDF for the first child of the root of the subtree
at hdfpath, or null if no child exists of that path or if the
path doesn't exist.
|
CSFileLoader |
getFileLoader()
Get the file loader in use, if any.
|
int |
getIntValue(String hdfname,
int default_value)
Retrieves the integer value at the specified path in this HDF node's
subtree.
|
JniHdf |
getObj(String hdfpath)
Retrieves the HDF object that is the root of the subtree at hdfpath, or
null if no object exists at that path.
|
JniHdf |
getOrCreateObj(String hdfpath)
Retrieves the HDF object that is the root of the subtree at
hdfpath, create the subtree if it doesn't exist
|
JniHdf |
getRootObj()
Return the root of the tree where the current node lies.
|
String |
getValue(String hdfname,
String default_value)
Retrieves the value at the specified path in this HDF node's subtree.
|
protected JniHdf |
newHdf(long hdfptr,
HDF parent)
Constructs an HDF child node.
|
JniHdf |
objChild()
Returns the child of this HDF node, or null if there is no child.
|
String |
objName()
Returns the name of this HDF node.
|
JniHdf |
objNext()
Returns the next sibling of this HDF node, or null if there is no next
sibling.
|
String |
objValue()
Returns the value of this HDF node, or null if this node has no value.
|
boolean |
readFile(String filename)
Loads the contents of the specified HDF file from disk into the current
HDF object.
|
boolean |
readString(String data)
Parses/loads the contents of the given string as HDF into the current
HDF object.
|
void |
removeTree(String hdfname)
Remove the specified subtree.
|
void |
setFileLoader(CSFileLoader fileLoader)
Set the CS file loader to use
|
void |
setSymLink(String hdf_name_src,
String hdf_name_dest)
Links the src hdf name to the dest.
|
void |
setValue(String hdfname,
String value)
Sets the value at the specified path in this HDF node's subtree.
|
boolean |
writeFile(String filename)
Serializes HDF contents to a file (readable by readFile)
|
String |
writeString()
Serializes HDF contents to a string (readable by readString)
|
public JniHdf()
protected JniHdf(long hdfptr,
JniHdf parent)
protected JniHdf newHdf(long hdfptr, HDF parent)
public void close()
protected void finalize()
throws Throwable
public boolean readFile(String filename) throws IOException
readFile in interface HDFfilename - the name of file to read in and parse.FileNotFoundException - if the specified file does not
exist.IOException - other problems reading the file.protected String fileLoad(String filename) throws IOException
IOExceptionpublic CSFileLoader getFileLoader()
getFileLoader in interface HDFpublic void setFileLoader(CSFileLoader fileLoader)
setFileLoader in interface HDFfileLoader - the file loader that should be used.public boolean writeFile(String filename) throws IOException
writeFile in interface HDFIOExceptionpublic boolean readString(String data)
readString in interface HDFpublic String writeString()
writeString in interface HDFpublic int getIntValue(String hdfname, int default_value)
getIntValue in interface HDFpublic String getValue(String hdfname, String default_value)
public void setValue(String hdfname, String value)
public void removeTree(String hdfname)
removeTree in interface HDFpublic void setSymLink(String hdf_name_src, String hdf_name_dest)
setSymLink in interface HDFpublic void exportDate(String hdfname, TimeZone timeZone, Date date)
exportDate in interface HDFpublic void exportDate(String hdfname, String tz, int tt)
exportDate in interface HDFpublic JniHdf getObj(String hdfpath)
public JniHdf getChild(String hdfpath)
public JniHdf getRootObj()
getRootObj in interface HDFpublic boolean belongsToSameRoot(HDF hdf)
HDFbelongsToSameRoot in interface HDFhdf - The hdf object to compare to.public JniHdf getOrCreateObj(String hdfpath)
getOrCreateObj in interface HDFpublic String objName()
public String objValue()
public JniHdf objChild()
public JniHdf objNext()
public void copy(String hdfpath, HDF src)
HDFThis method copies over the attributes and value of the node and recurses through all the children of the source node. Any symlink in the source node becomes a symlink in the copy.
Copyright © 2010–2013 Google. All rights reserved.