|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.keang.sudoku.Storage
public class Storage
Provides persistent storage and recovery of sudoku puzzles
Field Summary | |
---|---|
protected static java.lang.String |
SUDOKU_EXT
|
Constructor Summary | |
---|---|
Storage()
|
Method Summary | |
---|---|
static Puzzle |
load(java.awt.Component owner)
Loads a puzzle, displaying a file chooser dialog defaulting to the users default directory |
static Puzzle |
load(java.awt.Component owner,
java.io.File dir)
Loads a puzzle, displaying a file chooser dialog defaulting to the given directory |
static Puzzle |
load(java.io.File file)
Loads the puzzle from this file. |
static java.io.File |
save(Puzzle p,
java.awt.Component owner)
Saves this puzzle displaying a file chooser dialog defaulting to the users default directory |
static java.io.File |
save(Puzzle p,
java.awt.Component owner,
java.io.File dir)
Saves this puzzle displaying a file chooser dialog defaulting to the given directory |
static void |
save(Puzzle p,
java.io.File file)
Saves this puzzle to this file. |
static java.io.File |
selectFile(java.awt.Component owner,
java.io.File dir,
java.lang.String btnText)
Displays a file chooser dialog |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String SUDOKU_EXT
Constructor Detail |
---|
public Storage()
Method Detail |
---|
public static java.io.File save(Puzzle p, java.awt.Component owner) throws java.io.IOException
p
- the puzzle to saveowner
- the gui owner or null
java.io.IOException
public static java.io.File save(Puzzle p, java.awt.Component owner, java.io.File dir) throws java.io.IOException
p
- the puzzle to saveowner
- the gui owner or nulldir
- the directory or null. If a file is given, the files parent directory is used.
java.io.IOException
public static void save(Puzzle p, java.io.File file) throws java.io.IOException
p
- the puzzle to savefile
- the file to save to
java.io.IOException
public static Puzzle load(java.awt.Component owner) throws java.io.IOException, IllegalGridException
owner
- the gui owner or null
java.io.IOException
IllegalGridException
public static Puzzle load(java.awt.Component owner, java.io.File dir) throws java.io.IOException, IllegalGridException
owner
- the gui owner or nulldir
- the directory or null. If a file is given, the files parent directory is used.
java.io.IOException
IllegalGridException
public static Puzzle load(java.io.File file) throws java.io.IOException, IllegalGridException
file
- the file to load from
java.io.IOException
IllegalGridException
public static java.io.File selectFile(java.awt.Component owner, java.io.File dir, java.lang.String btnText)
owner
- dir
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |