Package nxt
Class Generator
- java.lang.Object
-
- nxt.Generator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGenerator.ActiveGeneratorActive generatorstatic classGenerator.Event
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaddListener(Listener<Generator> listener, Generator.Event eventType)intcompareTo(Generator g)longgetAccountId()static java.util.Collection<Generator>getAllGenerators()longgetDeadline()static GeneratorgetGenerator(java.lang.String secretPhrase)static intgetGeneratorCount()longgetHitTime()static java.util.List<Generator.ActiveGenerator>getNextGenerators()Return a list of generators for the next block.static longgetNextHitTime(long lastBlockId, int curTime)byte[]getPublicKey()static java.util.List<Generator>getSortedForgers()static booleanremoveListener(Listener<Generator> listener, Generator.Event eventType)static GeneratorstartForging(java.lang.String secretPhrase)static intstopForging()static GeneratorstopForging(java.lang.String secretPhrase)java.lang.StringtoString()
-
-
-
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:
compareToin interfacejava.lang.Comparable<Generator>
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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
-
-