public abstract class LevelPropagator extends Object
Modifier and Type | Field and Description |
---|---|
private boolean |
hasPendingUpdates |
private int |
levelCount |
private int |
minPendingLevel |
private it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet[] |
pendingIdUpdatesByLevel |
private it.unimi.dsi.fastutil.longs.Long2ByteMap |
pendingUpdates |
Modifier | Constructor and Description |
---|---|
protected |
LevelPropagator(int levelCount,
int expectedLevelSize,
int expectedTotalSize) |
Modifier and Type | Method and Description |
---|---|
private void |
addPendingUpdate(long id,
int level,
int targetLevel) |
protected int |
applyPendingUpdates(int maxSteps) |
protected abstract int |
getLevel(long id) |
int |
getPendingUpdateCount() |
protected abstract int |
getPropagatedLevel(long sourceId,
long targetId,
int level) |
protected boolean |
hasPendingUpdates() |
private void |
increaseMinPendingLevel(int maxLevel) |
protected abstract boolean |
isMarker(long id) |
private int |
minLevel(int a,
int b) |
protected abstract void |
propagateLevel(long id,
int level,
boolean decrease) |
protected void |
propagateLevel(long sourceId,
long targetId,
int level,
boolean decrease) |
protected abstract int |
recalculateLevel(long id,
long excludedId,
int maxLevel) |
protected void |
removePendingUpdate(long id) |
private void |
removePendingUpdate(long id,
int level,
int levelCount,
boolean removeFully) |
void |
removePendingUpdateIf(LongPredicate predicate) |
protected void |
resetLevel(long id) |
protected abstract void |
setLevel(long id,
int level) |
protected void |
updateLevel(long sourceId,
long id,
int level,
boolean decrease) |
private void |
updateLevel(long sourceId,
long id,
int level,
int currentLevel,
int pendingLevel,
boolean decrease) |
private final int levelCount
private final it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet[] pendingIdUpdatesByLevel
private final it.unimi.dsi.fastutil.longs.Long2ByteMap pendingUpdates
private int minPendingLevel
private volatile boolean hasPendingUpdates
protected LevelPropagator(int levelCount, int expectedLevelSize, int expectedTotalSize)
private int minLevel(int a, int b)
private void increaseMinPendingLevel(int maxLevel)
protected void removePendingUpdate(long id)
public void removePendingUpdateIf(LongPredicate predicate)
private void removePendingUpdate(long id, int level, int levelCount, boolean removeFully)
private void addPendingUpdate(long id, int level, int targetLevel)
protected void resetLevel(long id)
protected void updateLevel(long sourceId, long id, int level, boolean decrease)
private void updateLevel(long sourceId, long id, int level, int currentLevel, int pendingLevel, boolean decrease)
protected final void propagateLevel(long sourceId, long targetId, int level, boolean decrease)
protected final boolean hasPendingUpdates()
protected final int applyPendingUpdates(int maxSteps)
public int getPendingUpdateCount()
protected abstract boolean isMarker(long id)
protected abstract int recalculateLevel(long id, long excludedId, int maxLevel)
protected abstract void propagateLevel(long id, int level, boolean decrease)
protected abstract int getLevel(long id)
protected abstract void setLevel(long id, int level)
protected abstract int getPropagatedLevel(long sourceId, long targetId, int level)