Class LogEntry

java.lang.Object
  extended by LogEntry
All Implemented Interfaces:
java.io.Serializable

public class LogEntry
extends java.lang.Object
implements java.io.Serializable

Each instance of this class defines a single entry in a log file. Log entries can be of a variety of different types as defined by the final static vars in this class.

See Also:
Serialized Form

Field Summary
(package private) static int ADD_BLANK_TILE
          Defines an Add Blank Tile to TileBin log entry
(package private) static int ADD_BLANK_TILE_TO_GRID
          Defines an Add Blank Tile to Grid log entry
(package private)  java.lang.String blankDesc
          Description for blank tile
(package private)  java.lang.String blankName
          Name for blank tile
(package private) static int CHANGE_TILEBIN_WIDTH
          Defines a Change TileBin Width log entry
(package private) static int EDIT_BLANK_TILE
          Defines an Edit Blank Tile log entry
(package private)  long eTime
          End time of arrangement (save time)
(package private) static int GRID_TO_GRID
          Defines a Grid to Grid move log entry
(package private) static int GRID_TO_TILEBIN
          Defines a Grid to TileBin move log entry
(package private)  int hours
          Elapsed time at this entry: Hours
(package private)  int initialX
          Initial X position of the tile
(package private)  int initialY
          Initial Y position of the tile
(package private) static int LOAD_LOG
          Defines a Load Log log entry
(package private)  int minutes
          Elapsed time at this entry: Minutes
(package private)  int newX
          New X position of the tile
(package private)  int newY
          New Y position of the tile
(package private) static int NULL_ENTRY
          Defines a null log entry
(package private)  java.lang.String oldBlankDesc
          Old description for blank tile
(package private)  java.lang.String oldBlankName
          Old name for blank tile
(package private)  int prevHours
          Time since previous move: Hours
(package private)  int prevMinutes
          Time since previous move: Minutes
(package private)  int prevSeconds
          Time since previous move: Seconds
(package private) static int REMOVE_BLANK_FROM_GRID
          Defines a Remove Blank Tile from Grid log entry
(package private) static int REMVOE_BLANK_FROM_TILEBIN
          Defines a Remove Blank Tile from TileBin log entry
(package private) static int SAVE_LOG
          Defines a Save Log log entry
(package private)  int seconds
          Elapsed time at this entry: Seconds
(package private) static long serialVersionUID
           
(package private)  long sTime
          Start time of arrangement
(package private) static int TILEBIN_TO_GRID
          Defines a TileBin to Grid move log entry
(package private) static int TILEBIN_TO_TILEBIN
          Defines a TileBin to TileBin move log entry
(package private)  int tileID
          ID of the tile
(package private)  int type
          Type of move
 
Constructor Summary
LogEntry()
          The constructor for a log entry initializes all values to defaults.
 
Method Summary
 void initAddBlankTile(int id, java.lang.String name, java.lang.String desc)
          Initializes the entry to an 'add blank tile' entry.
 void initAddBlankTileToGrid(int id, java.lang.String name, java.lang.String desc, int x, int y)
          Initializes the entry to an 'add blank tile to grid' entry.
 void initEditBlankTile(int id, java.lang.String name, java.lang.String desc, java.lang.String oName, java.lang.String oDesc)
          Initializes the entry to an 'edit blank tile' entry.
 void initLoadLog()
          Initializes the entry to a 'load log' entry.
 void initMoveEntry(int theType, int id, int iX, int iY, int nX, int nY)
          Initializes the entry to a 'move' entry.
 void initRemoveBlankTile(int theType, int id, java.lang.String name, java.lang.String desc, int x, int y)
          Initializes the entry to a 'remove blank tile' entry.
 void initSaveLog(long st, long et)
          Initializes the entry to a 'save log' entry.
 void initTileBinWidthChange(int oX, int nX)
          Initializes the entry to a 'tilebin width change' entry.
 void print()
          Debug function that prints out all class vars to the console (seperated by commas).
 void printLong()
          Debug function that prints out all class vars to the console (comma separated, with var labels).
 void setTimes(int h, int m, int s, int lh, int lm, int ls)
          Sets the Elapsed and previous times for the entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

NULL_ENTRY

static final int NULL_ENTRY
Defines a null log entry

See Also:
Constant Field Values

TILEBIN_TO_TILEBIN

static final int TILEBIN_TO_TILEBIN
Defines a TileBin to TileBin move log entry

See Also:
Constant Field Values

TILEBIN_TO_GRID

static final int TILEBIN_TO_GRID
Defines a TileBin to Grid move log entry

See Also:
Constant Field Values

GRID_TO_GRID

static final int GRID_TO_GRID
Defines a Grid to Grid move log entry

See Also:
Constant Field Values

GRID_TO_TILEBIN

static final int GRID_TO_TILEBIN
Defines a Grid to TileBin move log entry

See Also:
Constant Field Values

ADD_BLANK_TILE

static final int ADD_BLANK_TILE
Defines an Add Blank Tile to TileBin log entry

See Also:
Constant Field Values

EDIT_BLANK_TILE

static final int EDIT_BLANK_TILE
Defines an Edit Blank Tile log entry

See Also:
Constant Field Values

REMOVE_BLANK_FROM_GRID

static final int REMOVE_BLANK_FROM_GRID
Defines a Remove Blank Tile from Grid log entry

See Also:
Constant Field Values

REMVOE_BLANK_FROM_TILEBIN

static final int REMVOE_BLANK_FROM_TILEBIN
Defines a Remove Blank Tile from TileBin log entry

See Also:
Constant Field Values

CHANGE_TILEBIN_WIDTH

static final int CHANGE_TILEBIN_WIDTH
Defines a Change TileBin Width log entry

See Also:
Constant Field Values

ADD_BLANK_TILE_TO_GRID

static final int ADD_BLANK_TILE_TO_GRID
Defines an Add Blank Tile to Grid log entry

See Also:
Constant Field Values

SAVE_LOG

static final int SAVE_LOG
Defines a Save Log log entry

See Also:
Constant Field Values

LOAD_LOG

static final int LOAD_LOG
Defines a Load Log log entry

See Also:
Constant Field Values

type

int type
Type of move


tileID

int tileID
ID of the tile


initialX

int initialX
Initial X position of the tile


initialY

int initialY
Initial Y position of the tile


newX

int newX
New X position of the tile


newY

int newY
New Y position of the tile


hours

int hours
Elapsed time at this entry: Hours


minutes

int minutes
Elapsed time at this entry: Minutes


seconds

int seconds
Elapsed time at this entry: Seconds


prevHours

int prevHours
Time since previous move: Hours


prevMinutes

int prevMinutes
Time since previous move: Minutes


prevSeconds

int prevSeconds
Time since previous move: Seconds


sTime

long sTime
Start time of arrangement


eTime

long eTime
End time of arrangement (save time)


blankName

java.lang.String blankName
Name for blank tile


blankDesc

java.lang.String blankDesc
Description for blank tile


oldBlankName

java.lang.String oldBlankName
Old name for blank tile


oldBlankDesc

java.lang.String oldBlankDesc
Old description for blank tile

Constructor Detail

LogEntry

public LogEntry()
The constructor for a log entry initializes all values to defaults.

Method Detail

setTimes

public void setTimes(int h,
                     int m,
                     int s,
                     int lh,
                     int lm,
                     int ls)
Sets the Elapsed and previous times for the entry.

Parameters:
h - Elapsed hours
m - Elapsed minutes
s - Elapsed seconds
lh - previous hours
lm - previous minutes
ls - previous seconds

initMoveEntry

public void initMoveEntry(int theType,
                          int id,
                          int iX,
                          int iY,
                          int nX,
                          int nY)
Initializes the entry to a 'move' entry.

Parameters:
theType - The type of move
id - The ID of the moved tile
iX - The initial X position of the moved tile
iY - The initial Y position of the moved tile
nX - The new X position of the moved tile
nY - The new Y position of the moved tile

initAddBlankTile

public void initAddBlankTile(int id,
                             java.lang.String name,
                             java.lang.String desc)
Initializes the entry to an 'add blank tile' entry.

Parameters:
id - Tile ID of the added tile
name - Name of the added tile
desc - Description of the added tile

initAddBlankTileToGrid

public void initAddBlankTileToGrid(int id,
                                   java.lang.String name,
                                   java.lang.String desc,
                                   int x,
                                   int y)
Initializes the entry to an 'add blank tile to grid' entry.

Parameters:
id - ID of the added tile
name - Name of the added tile
desc - Description of the added tile
x - Grid's X location of added tile
y - Grid's Y location of added tile

initEditBlankTile

public void initEditBlankTile(int id,
                              java.lang.String name,
                              java.lang.String desc,
                              java.lang.String oName,
                              java.lang.String oDesc)
Initializes the entry to an 'edit blank tile' entry.

Parameters:
id - ID of the edited tile
name - Name of the edited tile
desc - Description of the edited tile
oName - Old name of the edited tile
oDesc - Old description of the edited tile

initRemoveBlankTile

public void initRemoveBlankTile(int theType,
                                int id,
                                java.lang.String name,
                                java.lang.String desc,
                                int x,
                                int y)
Initializes the entry to a 'remove blank tile' entry.

Parameters:
theType - Type of removal (from grid or tilebin)
id - ID of removed tile
name - Name of removed tile
desc - Description of removed tile
x - X location of removed tile
y - Y location of removed tile

initTileBinWidthChange

public void initTileBinWidthChange(int oX,
                                   int nX)
Initializes the entry to a 'tilebin width change' entry.

Parameters:
oX - Old tile bin width
nX - New tile bin width

initSaveLog

public void initSaveLog(long st,
                        long et)
Initializes the entry to a 'save log' entry.

Parameters:
st - Start time of the log
et - End time of the log (save time)

initLoadLog

public void initLoadLog()
Initializes the entry to a 'load log' entry.


print

public void print()
Debug function that prints out all class vars to the console (seperated by commas).


printLong

public void printLong()
Debug function that prints out all class vars to the console (comma separated, with var labels).