Package io.github.wolfraam.chessgame.pgn
Class PGNImporter
java.lang.Object
io.github.wolfraam.chessgame.pgn.PGNImporter
Imports games in PGN format.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidImports the game from the File.voidrun(InputStream inputStream) Imports the game from the InputStream.voidsetAcceptTagsPredicate(Predicate<Map<PGNTag, String>> acceptTagsPredicate) Sets a Predicate which determines whether the game should be imported, based on the supplied tags.voidsetFen2NewChessGameFunction(Function<String, ChessGame> fen2NewChessGameFunction) Sets a Function which generates a ChessGame with the given FEN String.voidsetOnError(BiConsumer<String, RuntimeException> onError) Sets a Consumer which will be called with import errors.voidSets a Consumer which will be called with the imported ChessGames.voidsetOnWarning(Consumer<String> onWarning) Sets a Consumer which will be called with import warnings.
-
Constructor Details
-
PGNImporter
public PGNImporter()
-
-
Method Details
-
run
Imports the game from the InputStream. -
run
Imports the game from the File.- Throws:
FileNotFoundException
-
setAcceptTagsPredicate
Sets a Predicate which determines whether the game should be imported, based on the supplied tags. -
setFen2NewChessGameFunction
Sets a Function which generates a ChessGame with the given FEN String. Use this when you want to use a subclass of ChessGame. -
setOnError
Sets a Consumer which will be called with import errors. -
setOnGame
Sets a Consumer which will be called with the imported ChessGames. -
setOnWarning
Sets a Consumer which will be called with import warnings.
-