JComponentPack 1.5.0

com.zfqjava.swing
Class DefaultHistoryModel

java.lang.Object
  extended by com.zfqjava.swing.DefaultHistoryModel
All Implemented Interfaces:
HistoryModel

public class DefaultHistoryModel
extends Object
implements HistoryModel


Constructor Summary
DefaultHistoryModel()
           
 
Method Summary
 void add(Object o)
          Adds a item to this model.
 void addChangeListener(ChangeListener l)
          Adds the listener.
 Object current()
          Returns current object.
protected  void fireStateChanged()
          Notifies all listeners that have registered interest for notification on this event type.
 Object get(int index)
          Returns the item at the specified index.
 ChangeListener[] getChangeListeners()
          Returns an array of all the change listeners registered on this DefaultSingleSelectionModel.
 int getIndex()
          Returns the index of current item.
 boolean hasNext()
          Determines the model has next item.
 boolean hasPrevious()
          Determines the model has previous item.
 boolean isEmpty()
          Determines the model is empty.
 void removeChangeListener(ChangeListener l)
          Removes the listener.
 void setIndex(int index)
          Sets the current index to the specifed index.
 int size()
          Returns the size of this model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHistoryModel

public DefaultHistoryModel()
Method Detail

current

public Object current()
               throws NoSuchElementException
Description copied from interface: HistoryModel
Returns current object.

Specified by:
current in interface HistoryModel
Returns:
the current object
Throws:
NoSuchElementException

isEmpty

public boolean isEmpty()
Description copied from interface: HistoryModel
Determines the model is empty.

Specified by:
isEmpty in interface HistoryModel
Returns:
true if the model is empty

hasNext

public boolean hasNext()
Description copied from interface: HistoryModel
Determines the model has next item.

Specified by:
hasNext in interface HistoryModel
Returns:
true if the model has next item

hasPrevious

public boolean hasPrevious()
Description copied from interface: HistoryModel
Determines the model has previous item.

Specified by:
hasPrevious in interface HistoryModel
Returns:
true if the model has previouse item

size

public int size()
Description copied from interface: HistoryModel
Returns the size of this model.

Specified by:
size in interface HistoryModel
Returns:
the size

get

public Object get(int index)
           throws IndexOutOfBoundsException
Description copied from interface: HistoryModel
Returns the item at the specified index.

Specified by:
get in interface HistoryModel
Parameters:
index - the index
Throws:
IndexOutOfBoundsException

add

public void add(Object o)
Description copied from interface: HistoryModel
Adds a item to this model. If the model contains such object, set the index to that object index. All next items will remove from this model and the o will become current item.

Specified by:
add in interface HistoryModel

getIndex

public int getIndex()
Description copied from interface: HistoryModel
Returns the index of current item.

Specified by:
getIndex in interface HistoryModel
Returns:
the index.
See Also:
HistoryModel.setIndex(int)

setIndex

public void setIndex(int index)
              throws IndexOutOfBoundsException
Description copied from interface: HistoryModel
Sets the current index to the specifed index.

Specified by:
setIndex in interface HistoryModel
Parameters:
index - the index
Throws:
IndexOutOfBoundsException
See Also:
HistoryModel.getIndex()

addChangeListener

public void addChangeListener(ChangeListener l)
Description copied from interface: HistoryModel
Adds the listener.

Specified by:
addChangeListener in interface HistoryModel
Parameters:
l - the listener

removeChangeListener

public void removeChangeListener(ChangeListener l)
Description copied from interface: HistoryModel
Removes the listener.

Specified by:
removeChangeListener in interface HistoryModel
Parameters:
l - the listener

getChangeListeners

public ChangeListener[] getChangeListeners()
Returns an array of all the change listeners registered on this DefaultSingleSelectionModel.

Returns:
all of this model's ChangeListeners or an empty array if no change listeners are currently registered
See Also:
addChangeListener(javax.swing.event.ChangeListener), removeChangeListener(javax.swing.event.ChangeListener)

fireStateChanged

protected void fireStateChanged()
Notifies all listeners that have registered interest for notification on this event type. The event instance is created lazily.

See Also:
EventListenerList

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.