jmri.jmrit.operations.locations
Class Pool

java.lang.Object
  extended by jmri.jmrit.operations.locations.Pool

public class Pool
extends Object

Represents a pool of tracks that share their length.

Author:
Daniel Boudreau Copyright (C) 2011

Field Summary
protected  String _id
           
protected  String _name
           
protected  List<Track> _pool
           
static String DISPOSE
           
static String LISTCHANGE_CHANGED_PROPERTY
           
 
Constructor Summary
Pool(String id, String name)
           
 
Method Summary
 void add(Track track)
          Adds a track to this pool
 void addPropertyChangeListener(PropertyChangeListener l)
           
 void dispose()
           
protected  void firePropertyChange(String p, Object old, Object n)
           
 String getId()
           
 String getName()
           
 int getSize()
           
 List<Track> getTracks()
           
 void remove(Track track)
          Removes a track from this pool
 void removePropertyChangeListener(PropertyChangeListener l)
           
 boolean requestTrackLength(Track track, int length)
          Request track length from one of the other tracks in this pool.
 void setName(String name)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_id

protected String _id

_name

protected String _name

_pool

protected List<Track> _pool

LISTCHANGE_CHANGED_PROPERTY

public static final String LISTCHANGE_CHANGED_PROPERTY
See Also:
Constant Field Values

DISPOSE

public static final String DISPOSE
See Also:
Constant Field Values
Constructor Detail

Pool

public Pool(String id,
            String name)
Method Detail

getId

public String getId()

setName

public void setName(String name)

toString

public String toString()
Overrides:
toString in class Object

getName

public String getName()

getSize

public int getSize()

dispose

public void dispose()

add

public void add(Track track)
Adds a track to this pool

Parameters:
track - to be added.

remove

public void remove(Track track)
Removes a track from this pool

Parameters:
track - to be removed.

getTracks

public List<Track> getTracks()

requestTrackLength

public boolean requestTrackLength(Track track,
                                  int length)
Request track length from one of the other tracks in this pool.

Parameters:
track - the track requesting additional length
length - the amount of track length requested
Returns:
true if successful

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)

firePropertyChange

protected void firePropertyChange(String p,
                                  Object old,
                                  Object n)


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads