public class Snapshot
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
ImmutableArrayList<CellBackup> |
cellBackups |
int[] |
cellGroups |
Environment |
environment |
CellId[] |
groupMainSchematics |
IdManager |
idManager |
ImmutableArrayList<LibraryBackup> |
libBackups |
int |
snapshotId |
TechPool |
techPool |
Tool |
tool |
Constructor and Description |
---|
Snapshot(IdManager idManager)
Creates empty snapshot.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cellBoundsDefined()
Checks if all cell bounds are defined.
|
void |
check()
Checks invariant of this Snapshot.
|
Artwork |
getArtwork()
Returns Artwork technology in this database
|
CellBackup |
getCell(CellId cellId) |
CellBackup |
getCell(int cellIndex) |
ERectangle |
getCellBounds(CellId cellId) |
ERectangle |
getCellBounds(int cellIndex) |
CellRevision |
getCellRevision(CellId cellId) |
CellRevision |
getCellRevision(int cellIndex) |
java.util.Collection<CellId> |
getCellsDownTop() |
java.util.List<CellId> |
getChangedCells(Snapshot oldSnapshot) |
java.util.List<LibId> |
getChangedLibraries(Snapshot oldSnapshot) |
Generic |
getGeneric()
Returns Generic technology in this database
|
LibraryBackup |
getLib(LibId libId) |
Schematics |
getSchematics()
Returns Schematic technology in this database
|
java.util.Map<Setting,java.lang.Object> |
getSettings()
Returns map from Setting to its value in this Snapshot
|
Technology |
getTech(TechId techId)
Get Technology by TechId
TechId must belong to same IdManager as TechPool
|
TechPool |
getTechPool()
Returns TechPool of this Snapshot
|
static CellName |
makeCellGroupName(java.util.Collection<CellName> cellNames)
Returns group name of group with specified CellNames.
|
static Snapshot |
readSnapshot(IdReader reader,
Snapshot oldSnapshot) |
void |
setCellBounds(CellId cellId,
ERectangle r)
Sets cell bounds for a cell with given CellId
|
Snapshot |
with(Tool tool,
Environment environment,
CellBackup[] cellBackupsArray,
ERectangle[] cellBoundsArray,
LibraryBackup[] libBackupsArray)
Creates a new instance of Snapshot which differs from this Snapshot.
|
Snapshot |
withRenamedIds(IdMapper idMapper,
CellId fromGroup,
java.lang.String toGroup)
Returns Snapshot which differs from this Snapshot by renamed Ids.
|
void |
writeDiffs(IdWriter writer,
Snapshot oldSnapshot) |
public final IdManager idManager
public final int snapshotId
public final Tool tool
public final ImmutableArrayList<CellBackup> cellBackups
public final int[] cellGroups
public final CellId[] groupMainSchematics
public final ImmutableArrayList<LibraryBackup> libBackups
public final Environment environment
public final TechPool techPool
public Snapshot(IdManager idManager)
public Snapshot with(Tool tool, Environment environment, CellBackup[] cellBackupsArray, ERectangle[] cellBoundsArray, LibraryBackup[] libBackupsArray)
tool
- Tool which initiated database changes.environment
- Environment of this SnapshotcellBackupsArray
- array indexed by cellIndex of new CellBackups.cellBoundsArray
- array indexed by cellIndex of cell bounds.libBackupsArray
- array indexed by libIndex of LibraryBackups.java.lang.IllegalArgumentException
- on invariant violation.ArrayOutOfBoundsException
- on some invariant violations.public void setCellBounds(CellId cellId, ERectangle r)
cellId
- given CellIdr
- cell boubdsjava.lang.IllegalArgumentException
- if snapshot has not cell with given cellId or on bounds conflict.public Snapshot withRenamedIds(IdMapper idMapper, CellId fromGroup, java.lang.String toGroup)
idMapper
- a map from old Ids to new Ids.public java.util.Collection<CellId> getCellsDownTop()
public CellBackup getCell(CellId cellId)
public CellRevision getCellRevision(CellId cellId)
public CellBackup getCell(int cellIndex)
public CellRevision getCellRevision(int cellIndex)
public static CellName makeCellGroupName(java.util.Collection<CellName> cellNames)
cellNames
- collection of CellNames in a group.InvalidArgumentException
- if cellNames is emptypublic ERectangle getCellBounds(CellId cellId)
public ERectangle getCellBounds(int cellIndex)
public TechPool getTechPool()
public Technology getTech(TechId techId)
techId
- TechId to findjava.lang.IllegalArgumentException
- of TechId is not from this IdManagerpublic Artwork getArtwork()
public Generic getGeneric()
public Schematics getSchematics()
public java.util.Map<Setting,java.lang.Object> getSettings()
public LibraryBackup getLib(LibId libId)
public void writeDiffs(IdWriter writer, Snapshot oldSnapshot) throws java.io.IOException
java.io.IOException
public static Snapshot readSnapshot(IdReader reader, Snapshot oldSnapshot) throws java.io.IOException
java.io.IOException
public boolean cellBoundsDefined()
public void check()
java.lang.IllegalArgumentException
- on invariant violation.ArrayOutOfBoundsException
- on some invariant violations.java.lang.AssertionError
- if invariant is broken.java.lang.AssertionError
- if invariant is broken.