jfreerails.world.track
Class NullTrackPiece

java.lang.Object
  extended by jfreerails.world.track.NullTrackPiece
All Implemented Interfaces:
java.io.Serializable, FreerailsSerializable, TrackPiece

public final class NullTrackPiece
extends java.lang.Object
implements TrackPiece

A track piece that doesn't exist - using this avoids needing to check against null before calling the methods on a track piece.

Author:
lindsal
See Also:
Serialized Form

Field Summary
private static int NO_OWNER
           
private static TrackPiece nullTrackPiece
           
private static long serialVersionUID
           
 
Constructor Summary
private NullTrackPiece()
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
static TrackPiece getInstance()
           
 int getOwnerID()
           
 TrackConfiguration getTrackConfiguration()
           
 int getTrackGraphicID()
           
 TrackRule getTrackRule()
           
 int getTrackTypeID()
           
 int hashCode()
           
private  java.lang.Object readResolve()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

nullTrackPiece

private static final TrackPiece nullTrackPiece

NO_OWNER

private static final int NO_OWNER
See Also:
Constant Field Values
Constructor Detail

NullTrackPiece

private NullTrackPiece()
Method Detail

getInstance

public static TrackPiece getInstance()

getTrackGraphicID

public int getTrackGraphicID()
Specified by:
getTrackGraphicID in interface TrackPiece

getTrackRule

public TrackRule getTrackRule()
Specified by:
getTrackRule in interface TrackPiece

getTrackConfiguration

public TrackConfiguration getTrackConfiguration()
Specified by:
getTrackConfiguration in interface TrackPiece

readResolve

private java.lang.Object readResolve()
                              throws java.io.ObjectStreamException
Throws:
java.io.ObjectStreamException

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getOwnerID

public int getOwnerID()
Specified by:
getOwnerID in interface TrackPiece

getTrackTypeID

public int getTrackTypeID()
Specified by:
getTrackTypeID in interface TrackPiece