jphase
Class PhaseVarSet

java.lang.Object
  extended by jphase.PhaseVarSet
All Implemented Interfaces:
java.io.Serializable

public class PhaseVarSet
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
 java.lang.String fileName
           
 boolean isDirty
           
 java.lang.String name
           
 
Constructor Summary
PhaseVarSet()
          Default constructor
PhaseVarSet(PhaseVar[] vars)
          Contructs a new set with specified variables
PhaseVarSet(java.lang.String nam)
          Contructs a new set with specified name
PhaseVarSet(java.lang.String nam, PhaseVar[] vars)
          Contructs a new set with specified name and variables
 
Method Summary
 void add(PhaseVar var)
           
 double[] getMeans()
          Returns a vector with the means of all elements
 int indexOfName(java.lang.String s)
          Returns the index in the det of the variables with the specified name
 java.lang.String newUniqueVarName(java.lang.String proposedName)
          Builds a unique name for a variable from a proposed name
 int numVars()
          Returns the number of variables in the set
static PhaseVarSet open(java.lang.String fileName)
          Reads a .sed file with the information of a set
static PhaseVarSet openTxt(java.lang.String fileName)
          Reads a .txt file with the information of a set
 void remove(PhaseVar var)
          Remove the specified variable
 int remove(java.lang.String varName)
          Removes the variable with specified name
 void save()
           
 void save(java.lang.String fileName)
           
 boolean saveTxt()
          Saves the set information in a file
 boolean saveTxt(java.lang.String fileName)
          Saves the set information in a file
 java.lang.String toString()
           
 PhaseVar varAt(int i)
          Returns the variable at index i
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name

fileName

public java.lang.String fileName

isDirty

public boolean isDirty
Constructor Detail

PhaseVarSet

public PhaseVarSet()
Default constructor


PhaseVarSet

public PhaseVarSet(java.lang.String nam)
Contructs a new set with specified name

Parameters:
nam - Set name

PhaseVarSet

public PhaseVarSet(PhaseVar[] vars)
Contructs a new set with specified variables

Parameters:
vars - Set variables

PhaseVarSet

public PhaseVarSet(java.lang.String nam,
                   PhaseVar[] vars)
Contructs a new set with specified name and variables

Parameters:
nam - Set name
vars - Set variables
Method Detail

newUniqueVarName

public java.lang.String newUniqueVarName(java.lang.String proposedName)
Builds a unique name for a variable from a proposed name

Parameters:
proposedName - proposed name
Returns:
Unique name for a variable from a proposed name

add

public void add(PhaseVar var)
Parameters:
var -

varAt

public PhaseVar varAt(int i)
Returns the variable at index i

Parameters:
i - Index of the required variables
Returns:
Variable at intex i

indexOfName

public int indexOfName(java.lang.String s)
Returns the index in the det of the variables with the specified name

Parameters:
s - Name to be evaluated
Returns:
Index in the det of the variables with the specified name

numVars

public int numVars()
Returns the number of variables in the set

Returns:
Number of variables in the set

remove

public int remove(java.lang.String varName)
Removes the variable with specified name

Parameters:
varName - name of the varible to remove
Returns:
index of the removed variable

remove

public void remove(PhaseVar var)
Remove the specified variable

Parameters:
var - variable to remove

getMeans

public double[] getMeans()
Returns a vector with the means of all elements

Returns:
Vector with the means of all elements

open

public static PhaseVarSet open(java.lang.String fileName)
                        throws java.lang.Exception
Reads a .sed file with the information of a set

Parameters:
fileName - File with the variable set
Returns:
Set of variables in the file
Throws:
java.lang.Exception - IOException

openTxt

public static PhaseVarSet openTxt(java.lang.String fileName)
                           throws java.lang.Exception
Reads a .txt file with the information of a set

Parameters:
fileName - File with the variable set
Returns:
Set of variables in the file
Throws:
java.lang.Exception - IOException

save

public void save()
          throws java.io.IOException
Throws:
java.io.IOException

save

public void save(java.lang.String fileName)
          throws java.io.IOException
Parameters:
fileName -
Throws:
java.io.IOException

saveTxt

public boolean saveTxt()
                throws java.io.IOException
Saves the set information in a file

Returns:
True if the file could be saved, false elsewhere
Throws:
java.io.IOException

saveTxt

public boolean saveTxt(java.lang.String fileName)
                throws java.io.IOException
Saves the set information in a file

Parameters:
fileName - File name
Returns:
True if the file could be saved, false elsewhere
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object