Package nxt
Class Generator
- java.lang.Object
-
- nxt.Generator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Generator.ActiveGenerator
Active generatorstatic class
Generator.Event
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
addListener(Listener<Generator> listener, Generator.Event eventType)
int
compareTo(Generator g)
long
getAccountId()
static java.util.Collection<Generator>
getAllGenerators()
long
getDeadline()
static Generator
getGenerator(java.lang.String secretPhrase)
static int
getGeneratorCount()
long
getHitTime()
static java.util.List<Generator.ActiveGenerator>
getNextGenerators()
Return a list of generators for the next block.static long
getNextHitTime(long lastBlockId, int curTime)
byte[]
getPublicKey()
static java.util.List<Generator>
getSortedForgers()
static boolean
removeListener(Listener<Generator> listener, Generator.Event eventType)
static Generator
startForging(java.lang.String secretPhrase)
static int
stopForging()
static Generator
stopForging(java.lang.String secretPhrase)
java.lang.String
toString()
-
-
-
Method Detail
-
addListener
public static boolean addListener(Listener<Generator> listener, Generator.Event eventType)
-
removeListener
public static boolean removeListener(Listener<Generator> listener, Generator.Event eventType)
-
startForging
public static Generator startForging(java.lang.String secretPhrase)
-
stopForging
public static Generator stopForging(java.lang.String secretPhrase)
-
stopForging
public static int stopForging()
-
getGenerator
public static Generator getGenerator(java.lang.String secretPhrase)
-
getGeneratorCount
public static int getGeneratorCount()
-
getAllGenerators
public static java.util.Collection<Generator> getAllGenerators()
-
getSortedForgers
public static java.util.List<Generator> getSortedForgers()
-
getNextHitTime
public static long getNextHitTime(long lastBlockId, int curTime)
-
getPublicKey
public byte[] getPublicKey()
-
getAccountId
public long getAccountId()
-
getDeadline
public long getDeadline()
-
getHitTime
public long getHitTime()
-
compareTo
public int compareTo(Generator g)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Generator>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getNextGenerators
public static java.util.List<Generator.ActiveGenerator> getNextGenerators()
Return a list of generators for the next block. The caller must hold the blockchain read lock to ensure the integrity of the returned list.- Returns:
- List of generator account identifiers
-
-