edu.byu.ece.edif.core
Class EdifEnvironment

java.lang.Object
  extended by edu.byu.ece.edif.core.NamedPropertyObject
      extended by edu.byu.ece.edif.core.EdifEnvironment
All Implemented Interfaces:
EdifOut, Properties, Trimable, java.io.Serializable

public class EdifEnvironment
extends NamedPropertyObject
implements EdifOut, Trimable

Represents an environment for representing EDIF circuits.

An EDIF environment represents a list of EDIF libraries and has a top-level EDIF design. This object has a name and is not static so multiple EdifEnvironment objects may exist in a single JVM.

Version:
$Id:EdifEnvironment.java 198 2008-04-16 21:14:21Z jamesfcarroll $
See Also:
EdifDesign, EdifLibraryManager, Serialized Form

Field Summary
protected  java.lang.String _author
          Author string to be printed in final EDIF output.
protected  java.util.Date _date
          The date timestamp associated with this environment.
protected  EdifLibraryManager _libraries
          The EdifLibraryManager object representing the environment libraries.
protected  java.lang.String _program
          Program string to be printed in final EDIF output.
protected  EdifDesign _topDesign
          The top-level design associated with this environment.
protected  java.lang.String _version
          Version string to be printed in final EDIF output.
 int serialUID
           
 
Constructor Summary
EdifEnvironment(EdifNameable name)
          Construct an EdifEnvironment Object with the passed-in EdifNameable as its name Object.
EdifEnvironment(java.lang.String name)
          Construct an EdifEnvironment Object with the passed-in string as its name.
 
Method Summary
 void addLibrary(EdifLibrary library)
          Add the passed-in library to the appropriate position.
 java.lang.String getAuthor()
           
 java.util.Date getDate()
           
 EdifLibrary getLibrary(java.lang.String lib)
          Return the library that matches the passed in string.
 EdifLibraryManager getLibraryManager()
          Return the library manager.
 java.lang.String getProgram()
           
 EdifCell getTopCell()
          Return the top cell of the design.
 EdifCellInstance getTopCellInstance()
          Return the top instance of the design.
 EdifDesign getTopDesign()
          Return the top design.
 java.lang.String getVersion()
           
 void setAuthor(java.lang.String author)
           
 void setDate(java.util.Date date)
           
 void setDateWithCurrentTime()
          Set the date tag with the current time.
 void setProgram(java.lang.String program)
           
 void setTopCell(EdifCell cell)
           
 void setTopDesign(EdifDesign design)
          Set the top design.
 void setVersion(java.lang.String version)
           
 void toEdif(EdifPrintWriter epw)
          Convert this Object to EDIF format and prints it to the passed in EdifPrintWriter.
 void toEdif(EdifPrintWriter epw, boolean useCurrDate)
           
 java.lang.String toString()
          Return a String representation of this object.
 void trimToSize()
          Trim the size of this object.
 
Methods inherited from class edu.byu.ece.edif.core.NamedPropertyObject
addProperty, addProperty, addPropertyList, copyProperties, equals, equalsProperties, getEdifNameable, getName, getOldName, getProperty, getPropertyList, rename, rename, rename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialUID

public int serialUID

_libraries

protected EdifLibraryManager _libraries
The EdifLibraryManager object representing the environment libraries. An empty manager is created during construction.


_topDesign

protected EdifDesign _topDesign
The top-level design associated with this environment.


_date

protected java.util.Date _date
The date timestamp associated with this environment.


_author

protected java.lang.String _author
Author string to be printed in final EDIF output.


_program

protected java.lang.String _program
Program string to be printed in final EDIF output.


_version

protected java.lang.String _version
Version string to be printed in final EDIF output.

Constructor Detail

EdifEnvironment

public EdifEnvironment(java.lang.String name)
                throws InvalidEdifNameException
Construct an EdifEnvironment Object with the passed-in string as its name.

Parameters:
name - The name of the constructed EdifEnvironment Object
Throws:
InvalidEdifNameException

EdifEnvironment

public EdifEnvironment(EdifNameable name)
Construct an EdifEnvironment Object with the passed-in EdifNameable as its name Object.

Parameters:
name - The EdifNameable name of the constructed EdifEnvironment Object
Method Detail

addLibrary

public void addLibrary(EdifLibrary library)
                throws EdifNameConflictException
Add the passed-in library to the appropriate position.

Parameters:
library - The library to add TODO: should this method even exist?
Throws:
EdifNameConflictException

getLibrary

public EdifLibrary getLibrary(java.lang.String lib)
Return the library that matches the passed in string.

Parameters:
lib - The String name to match for when fetching the library

getLibraryManager

public EdifLibraryManager getLibraryManager()
Return the library manager.

Returns:
This EdifEnvironment's EdifLibraryManager

getTopCell

public EdifCell getTopCell()
Return the top cell of the design.

Returns:
The top EdifCell of this design

getTopCellInstance

public EdifCellInstance getTopCellInstance()
Return the top instance of the design.

Returns:
The top EdifCellInstance of this design

getTopDesign

public EdifDesign getTopDesign()
Return the top design.

Returns:
The top EdifDesign Object of this EdifEnvironment

getAuthor

public java.lang.String getAuthor()

setAuthor

public void setAuthor(java.lang.String author)

getDate

public java.util.Date getDate()

setDate

public void setDate(java.util.Date date)

setDateWithCurrentTime

public void setDateWithCurrentTime()
Set the date tag with the current time.


getProgram

public java.lang.String getProgram()

setProgram

public void setProgram(java.lang.String program)

setTopDesign

public void setTopDesign(EdifDesign design)
Set the top design.

Parameters:
design - The object that will become the new design for this EdifEnvironment

setTopCell

public void setTopCell(EdifCell cell)

getVersion

public java.lang.String getVersion()

setVersion

public void setVersion(java.lang.String version)

toEdif

public void toEdif(EdifPrintWriter epw)
Convert this Object to EDIF format and prints it to the passed in EdifPrintWriter. defaults to tool "BYU EDIF tools" and version "version 0.3.0"

Specified by:
toEdif in interface EdifOut
Parameters:
epw - The EdifPrintWriter that the EDIF data will be written to

toEdif

public void toEdif(EdifPrintWriter epw,
                   boolean useCurrDate)

toString

public java.lang.String toString()
Return a String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
A String representing the name and libraries contained in this EdifEnvironment Object

trimToSize

public void trimToSize()
Trim the size of this object.

Specified by:
trimToSize in interface Trimable