public class Snapshot
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
ImmutableArrayList<CellBackup> |
cellBackups |
static boolean |
CELLNAMES_IGNORE_CASE
Flag to disable cells whose names differ by case.
|
ImmutableArrayList<CellTree> |
cellTrees |
Environment |
environment |
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 |
cellGroupsProbablyChanged(Snapshot that) |
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) |
int |
getCellGroupIndex(CellId cellId) |
CellRevision |
getCellRevision(CellId cellId) |
CellRevision |
getCellRevision(int cellIndex) |
java.util.Collection<CellId> |
getCellsDownTop() |
CellTree |
getCellTree(CellId cellId) |
CellTree |
getCellTree(int cellIndex) |
java.util.List<CellId> |
getChangedCells(Snapshot oldSnapshot) |
java.util.List<LibId> |
getChangedLibraries(Snapshot oldSnapshot) |
EquivalentSchematicExports |
getEquivExports(CellId top) |
Generic |
getGeneric()
Returns Generic technology in this database
|
LibraryBackup |
getLib(LibId libId) |
CellId |
getMainSchematics(CellId cellId) |
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) |
Snapshot |
with(Tool tool,
Environment environment) |
Snapshot |
with(Tool tool,
Environment environment,
CellBackup[] cellBackupsArray,
LibraryBackup[] libBackupsArray)
Creates a new instance of Snapshot which differs from this Snapshot.
|
Snapshot |
with(Tool tool,
Environment environment,
CellTree[] cellTreesArray,
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 static final boolean CELLNAMES_IGNORE_CASE
public final IdManager idManager
public final int snapshotId
public final Tool tool
public final ImmutableArrayList<CellTree> cellTrees
public final ImmutableArrayList<CellBackup> cellBackups
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, LibraryBackup[] libBackupsArray)
tool
- Tool which initiated database changes.environment
- Environment of this SnapshotcellBackupsArray
- array indexed by cellIndex of new CellBackups.libBackupsArray
- array indexed by libIndex of LibraryBackups.java.lang.IllegalArgumentException
- on invariant violation.ArrayOutOfBoundsException
- on some invariant violations.public Snapshot with(Tool tool, Environment environment, CellTree[] cellTreesArray, LibraryBackup[] libBackupsArray)
tool
- Tool which initiated database changes.environment
- Environment of this SnapshotcellTreesArray
- array indexed by cellIndex of new CellTrees.libBackupsArray
- array indexed by libIndex of LibraryBackups.java.lang.IllegalArgumentException
- on invariant violation.ArrayOutOfBoundsException
- on some invariant violations.public Snapshot with(Tool tool, Environment environment)
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 CellTree getCellTree(int cellIndex)
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 EquivalentSchematicExports getEquivExports(CellId top)
public ERectangle getCellBounds(CellId cellId)
public ERectangle getCellBounds(int cellIndex)
public int getCellGroupIndex(CellId cellId)
public boolean cellGroupsProbablyChanged(Snapshot that)
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 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.