public class FileFragment extends Object implements IFileFragment
| Modifier and Type | Field and Description |
|---|---|
static String |
NUMBERFORMAT |
| Constructor and Description |
|---|
FileFragment()
Create a FileFragment
|
FileFragment(File f)
Create a FileFragment connected to File f.
|
FileFragment(File basedir,
String name)
Create a plain FileFragment at basedir with name.
|
FileFragment(URI u)
Create a FileFragment connected to URI u.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(Attribute a)
Add an attribute
|
IVariableFragment |
addChild(String name)
Add a child of given name or return already existing one.
|
void |
addChildren(IVariableFragment... fragments)
Add a number of children.
|
void |
addDimensions(Dimension... dims1)
Add dimensions to this IFileFragment.
|
void |
addSourceFile(Collection<IFileFragment> c)
Add source FileFragments contained in Collection c to this FileFragment.
|
void |
addSourceFile(IFileFragment... ff)
Add source FileFragments contained in ff to this FileFragment.
|
void |
appendXML(org.jdom.Element e)
Append structural information of this FileFragment to Element e.
|
void |
clearArrays()
Iterates through all VariableFragments, clearing in memory arrays, except
for source_files.
|
void |
clearDimensions()
Resets all dimensions of this fragment.
|
int |
compare(IFragment arg0,
IFragment arg1)
Compare Fragments by comparing their string representations.
|
int |
compareTo(Object arg0)
Only perform comparison on instances of Fragment.
|
boolean |
equals(Object obj) |
String |
getAbsolutePath()
Return this FileFragment's storage location as string representation.
|
Attribute |
getAttribute(Attribute a)
Return a given Attribute.
|
Attribute |
getAttribute(String name)
Return a given Attribute by name.
|
List<Attribute> |
getAttributes()
Return attributes of Fragment.
|
ICacheDelegate<IVariableFragment,List<Array>> |
getCache()
Return a Cache for variable fragment array data for this fragment.
|
IVariableFragment |
getChild(String varname)
Returns the child with name varname.
|
IVariableFragment |
getChild(String varname,
boolean loadStructureOnly)
Returns the child with name varname.
|
Set<Dimension> |
getDimensions()
The registered dimensions of this FileFragment as an unmodifiable Set.
|
long |
getID()
The unique ID (between runs) of this FileFragment.
|
List<IVariableFragment> |
getImmediateChildren()
Returns the immediate children of this fileFragment.
|
String |
getName()
Return the name of this FileFragment, does not include directory or other
prefixed information.
|
IGroupFragment |
getParent() |
int |
getSize()
Return the number of children of this FileFragment.
|
Collection<IFileFragment> |
getSourceFiles()
Use this method with caution!
|
StatsMap |
getStats()
Retrieve statistics from a Fragment.
|
URI |
getUri()
Get the uniform resource identifier for this FileFragment.
|
boolean |
hasAttribute(Attribute a)
Query for an Attribute.
|
boolean |
hasAttribute(String name)
Query for an Attribute by name.
|
boolean |
hasChild(IVariableFragment vf)
Query this fragment for knowledge of a given VariableFragment.
|
boolean |
hasChild(String varname)
Query this fragment for knowledge of a child variable with the given
name.
|
boolean |
hasChildren(IVariableFragment... vf)
Query FileFragment for the given VariableFragments.
|
boolean |
hasChildren(String... s)
Query FileFragment for children with the given strings as names.
|
int |
hashCode() |
boolean |
isModified() |
Iterator<IVariableFragment> |
iterator()
Creates an iterator over all children of this FileFragment by the time of
creation of the iterator.
|
long |
nextGID() |
static String |
printFragment(IFileFragment ff) |
void |
readExternal(ObjectInput in) |
void |
readStructure()
Call the
IDataSource for this FileFragment and load the structural
information for this fragment. |
void |
removeChild(IVariableFragment variableFragment)
Remove the given IVariableFragment from the list of this FileFragment's
children.
|
void |
removeSourceFile(IFileFragment ff)
Remove the given source file.
|
void |
removeSourceFiles()
Removes all currently associated source files.
|
boolean |
save()
Store this fragment using the
IDataSource responsible for handling
this fragment name's extension. |
void |
setAttributes(Attribute... a)
Set attributes on a fragment.
|
void |
setCache(ICacheDelegate<IVariableFragment,List<Array>> persistentCache)
Sets the array cache of this FileFragment as specified if the current
cache has not yet been initialized (is null).
|
void |
setFile(File f1)
Change the filename of this Fragment.
|
void |
setFile(String file)
Change the filename of this Fragment.
|
void |
setID(long id) |
void |
setStats(StatsMap stats1)
Set statistics on a Fragment.
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public static final String NUMBERFORMAT
public FileFragment()
public FileFragment(File f)
f - public FileFragment(URI u)
u - public static String printFragment(IFileFragment ff)
public void setCache(ICacheDelegate<IVariableFragment,List<Array>> persistentCache)
IllegalStateException otherwise to prevent loss of cached data.setCache in interface IFileFragmentIllegalStateExceptionpublic IVariableFragment addChild(String name)
IFileFragmentaddChild in interface IFileFragmentpublic void addChildren(IVariableFragment... fragments)
IFileFragmentaddChildren in interface IFileFragmentaddChildren in interface IGroupFragmentpublic void addDimensions(Dimension... dims1)
IFileFragmentaddDimensions in interface IFileFragmentpublic void addSourceFile(Collection<IFileFragment> c)
IFileFragmentaddSourceFile in interface IFileFragmentpublic void addSourceFile(IFileFragment... ff)
IFileFragmentaddSourceFile in interface IFileFragmentpublic void appendXML(org.jdom.Element e)
IFileFragmentappendXML in interface IFileFragmentappendXML in interface IXMLSerializablepublic void clearArrays()
throws IllegalStateException
IFileFragmentclearArrays in interface IFileFragmentIllegalStateExceptionpublic void clearDimensions()
IFileFragmentclearDimensions in interface IFileFragmentpublic int compare(IFragment arg0, IFragment arg1)
IFragmentcompare in interface IFragmentcompare in interface Comparator<IFragment>arg0 - arg1 - Fragment.compare(cross.datastructures.fragments.IFragment,
cross.datastructures.fragments.IFragment)public int compareTo(Object arg0)
IFragmentcompareTo in interface IFragmentcompareTo in interface Comparable<Object>arg0 - Fragment.compareTo(java.lang.Object)public String getAbsolutePath()
IFileFragmentgetAbsolutePath in interface IFileFragmentpublic Attribute getAttribute(Attribute a)
IFragmentgetAttribute in interface IFragmenta - Fragment.getAttribute(ucar.nc2.Attribute)public Attribute getAttribute(String name)
IFragmentgetAttribute in interface IFragmentname - Fragment.getAttribute(java.lang.String)public List<Attribute> getAttributes()
IFragmentgetAttributes in interface IFragmentFragment.getAttributes()public ICacheDelegate<IVariableFragment,List<Array>> getCache()
IFileFragmentgetCache in interface IFileFragmentcross.datastructures.fragments.Fragment#getCache()public IVariableFragment getChild(String varname) throws ResourceNotAvailableException
IFileFragmentgetChild in interface IFileFragmentgetChild in interface IGroupFragmentvarname - ResourceNotAvailableExceptionIFileFragment.getChild(String)public IVariableFragment getChild(String varname, boolean loadStructureOnly) throws ResourceNotAvailableException
IFileFragmentloadStructureOnly is true, only the variable structure is
retrieved, not the data.getChild in interface IFileFragmentvarname - loadStructureOnly - ResourceNotAvailableExceptionIFileFragment.getChild(String,
boolean)public List<IVariableFragment> getImmediateChildren()
IFileFragmentgetImmediateChildren in interface IFileFragmentpublic long getID()
IFileFragmentgetID in interface IFileFragmentpublic String getName()
IFileFragmentgetName in interface IFileFragmentgetName in interface IGroupFragmentpublic IGroupFragment getParent()
getParent in interface IFileFragmentgetParent in interface IGroupFragmentpublic int getSize()
IFileFragmentgetSize in interface IFileFragmentgetSize in interface IGroupFragmentpublic Collection<IFileFragment> getSourceFiles()
tools.FragmentTools.getSourceFiles(IFileFragment f).getSourceFiles in interface IFileFragmentpublic StatsMap getStats()
IFragmentpublic URI getUri()
getUri in interface IFileFragmentpublic boolean hasAttribute(Attribute a)
IFragmenthasAttribute in interface IFragmenta - Fragment.hasAttribute(ucar.nc2.Attribute)public boolean hasAttribute(String name)
IFragmenthasAttribute in interface IFragmentname - Fragment.hasAttribute(java.lang.String)public boolean hasChild(IVariableFragment vf)
IGroupFragmenthasChild in interface IGroupFragmentpublic boolean hasChild(String varname)
IGroupFragmenthasChild in interface IGroupFragmentpublic boolean hasChildren(IVariableFragment... vf)
IFileFragmenthasChildren in interface IFileFragmentpublic boolean hasChildren(String... s)
IFileFragmenthasChildren in interface IFileFragmentpublic boolean isModified()
isModified in interface IFileFragmentpublic Iterator<IVariableFragment> iterator()
IFileFragmentiterator in interface IFileFragmentiterator in interface Iterable<IVariableFragment>public long nextGID()
nextGID in interface IGroupFragmentpublic void readStructure()
throws IllegalStateException
IFileFragmentIDataSource for this FileFragment and load the structural
information for this fragment. This includes variable names and shapes
as well as attributes.readStructure in interface IFileFragmentIllegalStateException - if this fragment has been modified to
indicate possible loss of data.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface Externalizablein - IOExceptionClassNotFoundExceptionpublic void removeChild(IVariableFragment variableFragment)
IFileFragmentremoveChild in interface IFileFragmentpublic void removeSourceFile(IFileFragment ff)
IFileFragmentremoveSourceFile in interface IFileFragmentpublic void removeSourceFiles()
IFileFragmentremoveSourceFiles in interface IFileFragmentpublic boolean save()
IFileFragmentIDataSource responsible for handling
this fragment name's extension.save in interface IFileFragmentpublic void setAttributes(Attribute... a)
IFragmentsetAttributes in interface IFragmenta - Fragment.setAttributes(ucar.nc2.Attribute[])public void addAttribute(Attribute a)
IFragmentaddAttribute in interface IFragmentpublic void setFile(File f1)
IFileFragmentsetFile in interface IFileFragmentpublic void setFile(String file)
IFileFragmentsetFile in interface IFileFragmentpublic void setID(long id)
setID in interface IGroupFragmentid - public void setStats(StatsMap stats1)
IFragmentsetStats in interface IFragmentstats1 - Fragment.setStats(cross.datastructures.StatsMap)public String toString()
toString in interface IFileFragmenttoString in class Objectpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface Externalizableout - IOExceptionpublic Set<Dimension> getDimensions()
getDimensions in interface IFileFragmentCopyright © 2007-2013. All Rights Reserved.