T - public abstract static class Flag.DoInSync<T> extends Object
Example:
flag.inSync(
new Flag.DoInSync<Integer>(flag) {
public abstract void execute(Integer flagValue) {
setFlag(flagValue+1);
}
}
);
Flag<Integer> flag = new Flag<Integer>(10);
No need to do anything else! The class will submit itself to the flag upon construction.
Use it to create correct counters (or use directly FlagInteger class).
| Constructor and Description |
|---|
DoInSync() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
execute(T flagValue) |
protected T |
getFlag() |
protected boolean |
isImmutable()
Tells you whether you operate over immutable flag (can't call setFlag() then) or not.
|
protected void |
setFlag(T value)
Set value in sync.
|
protected boolean isImmutable()
protected void setFlag(T value)
protected T getFlag()
public abstract void execute(T flagValue)
flag - Copyright © 2019 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.