public class JHdf extends Object implements HDF
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.
|
void |
optimize()
JSilver-specific method that optimizes the underlying data object.
|
boolean |
readFile(String filename)
Loads the contents of the specified HDF file from disk into the current
HDF object.
|
boolean |
readString(String content)
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.
|
String |
toString() |
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 void close()
HDF
public boolean readFile(String filename) throws IOException
HDF
readFile
in interface HDF
IOException
public CSFileLoader getFileLoader()
HDF
getFileLoader
in interface HDF
public void setFileLoader(CSFileLoader fileLoader)
HDF
setFileLoader
in interface HDF
fileLoader
- the file loader that should be used.public boolean writeFile(String filename) throws IOException
HDF
writeFile
in interface HDF
IOException
public boolean readString(String content)
HDF
readString
in interface HDF
public int getIntValue(String hdfName, int defaultValue)
HDF
getIntValue
in interface HDF
public String getValue(String hdfName, String defaultValue)
HDF
public void setValue(String hdfName, String value)
HDF
public void removeTree(String hdfName)
HDF
removeTree
in interface HDF
public void setSymLink(String hdfNameSrc, String hdfNameDest)
HDF
setSymLink
in interface HDF
public void exportDate(String hdfName, TimeZone timeZone, Date date)
HDF
exportDate
in interface HDF
public void exportDate(String hdfName, String tz, int tt)
HDF
exportDate
in interface HDF
public HDF getObj(String hdfpath)
HDF
public HDF getChild(String hdfpath)
HDF
public HDF getRootObj()
HDF
HDF
every time.
Use HDF.belongsToSameRoot(HDF)
to check if two HDF
s
belong to the same root.getRootObj
in interface HDF
public boolean belongsToSameRoot(HDF hdf)
HDF
belongsToSameRoot
in interface HDF
hdf
- The hdf object to compare to.public HDF getOrCreateObj(String hdfpath)
HDF
getOrCreateObj
in interface HDF
public String objName()
HDF
public String objValue()
HDF
public HDF objChild()
HDF
public HDF objNext()
HDF
public void copy(String hdfpath, HDF src)
HDF
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.
public String dump()
HDF
public String writeString()
HDF
writeString
in interface HDF
public void optimize()
Copyright © 2010–2015 Google. All rights reserved.