public interface HDF extends Closeable
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 CS object state.
|
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
|
HDF |
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 defaultValue)
Retrieves the integer value at the specified path in this HDF node's
subtree.
|
HDF |
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.
|
HDF |
getOrCreateObj(String hdfpath)
Retrieves the HDF object that is the root of the subtree at
hdfpath, create the subtree if it doesn't exist
|
HDF |
getRootObj()
Return the root of the tree where the current node lies.
|
String |
getValue(String hdfName,
String defaultValue)
Retrieves the value at the specified path in this HDF node's subtree.
|
HDF |
objChild()
Returns the child of this HDF node, or null if there is no child.
|
String |
objName()
Returns the name of this HDF node.
|
HDF |
objNext()
Returns the child of this HDF node, or null if there is no child.
|
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 hdfNameSrc,
String hdfNameDest)
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)
|
void close()
close
in interface AutoCloseable
close
in interface Closeable
boolean readFile(String filename) throws IOException
IOException
CSFileLoader getFileLoader()
void setFileLoader(CSFileLoader fileLoader)
fileLoader
- the file loader that should be used.boolean writeFile(String filename) throws IOException
IOException
boolean readString(String data)
String writeString()
int getIntValue(String hdfName, int defaultValue)
String getValue(String hdfName, String defaultValue)
void setValue(String hdfName, String value)
void removeTree(String hdfName)
void setSymLink(String hdfNameSrc, String hdfNameDest)
void exportDate(String hdfName, TimeZone timeZone, Date date)
void exportDate(String hdfName, String tz, int tt)
HDF getObj(String hdfpath)
HDF getChild(String hdfpath)
HDF getRootObj()
HDF
every time.
Use belongsToSameRoot(HDF)
to check if two HDF
s
belong to the same root.boolean belongsToSameRoot(HDF hdf)
hdf
- The hdf object to compare to.IllegalArgumentException
- If the supplied hdf object is from
a different implementation (e.g. mixing JNI and jsilver).HDF getOrCreateObj(String hdfpath)
String objName()
String objValue()
HDF objChild()
HDF objNext()
void copy(String hdfpath, HDF src)
This 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.
hdfpath
- the node within this HDF where the source structure should
be copied to.src
- the source HDF to copy over.String dump()
Copyright © 2010-2014 Google. All Rights Reserved.