ReportMill 12 API

com.reportmill.datasource
Class RMFile

java.lang.Object
  extended by com.reportmill.base.RMObject
      extended by com.reportmill.datasource.RMFile
All Implemented Interfaces:
com.reportmill.base.RMPropertyChanger, java.lang.Cloneable, java.lang.Comparable

public class RMFile
extends com.reportmill.base.RMObject
implements java.lang.Comparable

Represents a file from a datasource.


Method Summary
 void addChild(RMFile aFile)
          Adds a child.
 void addChild(RMFile aFile, int anIndex)
          Adds a child at given index.
 int compareTo(java.lang.Object anObj)
          Used to sort files.
 void delete()
          Deletes the file.
 byte[] getBytes()
          Returns the file bytes.
 RMFile getChild(int anIndex)
          Returns the individual child at given index.
 RMFile getChild(java.lang.String aName)
          Returns the child with the given name.
 int getChildCount()
          Returns the number of children.
 int getChildIndex(RMFile aFile)
          Returns the index of a child.
 java.util.List<? extends RMFile> getChildren()
          Returns the directory children.
 RMDataSource getDataSource()
          Returns the datasource.
 java.lang.String getDirectoryPath()
          Returns the path as a directory (with trailing separator).
 int getInsertIndex(RMFile aFile)
          Returns the insert index to insert a file in this directory.
 java.lang.String getName()
          Returns the resource name.
 RMFile getParent()
          Returns the file parent directory.
 java.lang.String getPath()
          Returns the file path.
 java.lang.String getSimpleName()
          Returns the file simple name.
 java.lang.String getType()
          Returns the file type (extension without the '.').
 RMFile getVisibleChild(int anIndex)
          Returns the individual visible child at index.
 int getVisibleChildCount()
          Returns the number of visible children.
 java.util.List<RMFile> getVisibleChildren()
          Returns the visible children.
 boolean isDirectory()
          Returns whether resource is a directory.
 boolean isVisible()
          Returns whether file is visible (not hidden).
 RMFile removeChild(int anIndex)
          Removes a child at given index.
 int removeChild(RMFile aFile)
          Removes given child.
 void save()
          Saves the file.
 void setBytes(byte[] theBytes)
          Sets the file bytes.
 void setDirectory(boolean aValue)
          Sets whether resource is a directory.
 void setPath(java.lang.String aPath)
          Sets the file path.
 void setVisible(boolean aValue)
          Sets whether file is visible (not hidden).
 java.lang.String toString()
          Returns a string representation of file.
 
Methods inherited from class com.reportmill.base.RMObject
addListener, addPropertyChangeListener, animUpdate, clone, firePropertyChange, firePropertyChange, getListener, getListenerCount, getListeners, isFirePropertyChangeEnabled, isUndoing, removeListener, removePropertyChangeListener, setFirePropertyChangeEnabled, setUndoing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getDataSource

public RMDataSource getDataSource()
Returns the datasource.


getPath

public java.lang.String getPath()
Returns the file path.


setPath

public void setPath(java.lang.String aPath)
Sets the file path.


getName

public java.lang.String getName()
Returns the resource name.


getSimpleName

public java.lang.String getSimpleName()
Returns the file simple name.


getType

public java.lang.String getType()
Returns the file type (extension without the '.').


getDirectoryPath

public java.lang.String getDirectoryPath()
Returns the path as a directory (with trailing separator).


isDirectory

public boolean isDirectory()
Returns whether resource is a directory.


setDirectory

public void setDirectory(boolean aValue)
Sets whether resource is a directory.


getParent

public RMFile getParent()
Returns the file parent directory.


getChildCount

public int getChildCount()
Returns the number of children.


getChild

public RMFile getChild(int anIndex)
Returns the individual child at given index.


getChildren

public java.util.List<? extends RMFile> getChildren()
Returns the directory children.


addChild

public void addChild(RMFile aFile)
Adds a child.


addChild

public void addChild(RMFile aFile,
                     int anIndex)
Adds a child at given index.


removeChild

public RMFile removeChild(int anIndex)
Removes a child at given index.


removeChild

public int removeChild(RMFile aFile)
Removes given child.


getChild

public RMFile getChild(java.lang.String aName)
Returns the child with the given name.


getChildIndex

public int getChildIndex(RMFile aFile)
Returns the index of a child.


getInsertIndex

public int getInsertIndex(RMFile aFile)
Returns the insert index to insert a file in this directory.


isVisible

public boolean isVisible()
Returns whether file is visible (not hidden).


setVisible

public void setVisible(boolean aValue)
Sets whether file is visible (not hidden).


getVisibleChildCount

public int getVisibleChildCount()
Returns the number of visible children.


getVisibleChild

public RMFile getVisibleChild(int anIndex)
Returns the individual visible child at index.


getVisibleChildren

public java.util.List<RMFile> getVisibleChildren()
Returns the visible children.


getBytes

public byte[] getBytes()
Returns the file bytes.


setBytes

public void setBytes(byte[] theBytes)
Sets the file bytes.


save

public void save()
Saves the file.


delete

public void delete()
Deletes the file.


compareTo

public int compareTo(java.lang.Object anObj)
Used to sort files.

Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Returns a string representation of file.

Overrides:
toString in class com.reportmill.base.RMObject

ReportMill 12 API