alonefichiers
Class Fichier

java.lang.Object
  extended by alonefichiers.Fichier
Direct Known Subclasses:
FichierBracket, FichierConvert, FichierFasta, FichierRnaViz

public class Fichier
extends java.lang.Object

This class to ensure a generic file format use.

Author:
Stéfan Engelen (2006), Gabriel Chandesris (2008)

Field Summary
private  java.lang.String[] champs
          File String fields.
private  java.lang.String datatype
          File type.
private static java.lang.String dir
          File directory.
private  boolean formatValide
          File is valid or not.
private  java.lang.String nom
          File name.
 
Constructor Summary
Fichier(java.lang.String nom)
          Constructor with given name.
Fichier(java.lang.String type, java.lang.String nom)
          Constructor with given type and name.
Fichier(java.lang.String nom, java.lang.String[] champs)
          Constructor with given name and champs.
Fichier(java.lang.String type, java.lang.String nom, java.lang.String[] champs)
          Constructor with given type, name and champs.
 
Method Summary
 void addToChamps(java.lang.String nextLine)
           
 java.lang.String getChamp(int i)
           
 java.lang.String[] getChamps()
           
 java.lang.String getChampsToString()
           
 java.lang.String getNom()
           
 java.lang.String getType()
           
 boolean isValid()
           
 int length()
           
 java.lang.String printFile()
          This method to create files.
static java.lang.String readFile(java.lang.String filename)
          To obtain the content of a given file.
 void setChamps(int i, java.lang.String champs)
           
 void setChamps(java.lang.String[] champs)
           
protected  void setValid(boolean valid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dir

private static final java.lang.String dir
File directory.

See Also:
Constant Field Values

datatype

private java.lang.String datatype
File type.


nom

private java.lang.String nom
File name.


champs

private java.lang.String[] champs
File String fields.

See Also:
FichierRnaViz

formatValide

private boolean formatValide
File is valid or not.

Constructor Detail

Fichier

public Fichier(java.lang.String nom)
Constructor with given name. Type is empty. Champs has length of 0. Validity is false (default).

Parameters:
nom - String

Fichier

public Fichier(java.lang.String type,
               java.lang.String nom)
Constructor with given type and name. Champs has length of 0. Validity is false (default).

Parameters:
type -
nom -

Fichier

public Fichier(java.lang.String nom,
               java.lang.String[] champs)
Constructor with given name and champs. Type is empty. Validity is false (default).

Parameters:
nom -
champs -

Fichier

public Fichier(java.lang.String type,
               java.lang.String nom,
               java.lang.String[] champs)
Constructor with given type, name and champs. Validity is false (default).

Parameters:
type -
nom -
champs -
Method Detail

length

public int length()

getType

public java.lang.String getType()

getNom

public java.lang.String getNom()

getChamps

public java.lang.String[] getChamps()

getChamp

public java.lang.String getChamp(int i)

isValid

public boolean isValid()

addToChamps

public void addToChamps(java.lang.String nextLine)

setChamps

public void setChamps(java.lang.String[] champs)

setChamps

public void setChamps(int i,
                      java.lang.String champs)

setValid

protected void setValid(boolean valid)

getChampsToString

public java.lang.String getChampsToString()

readFile

public static java.lang.String readFile(java.lang.String filename)
To obtain the content of a given file. Return name of the exception if throw...

Parameters:
filename - String
Returns:
(String)What the file contain or exception.

printFile

public java.lang.String printFile()
This method to create files.

Returns:
String (action result).