JComponentPack 1.5.0

com.zfqjava.swing
Interface HistoryModel

All Known Implementing Classes:
DefaultHistoryModel

public interface HistoryModel


Method Summary
 void add(Object o)
          Adds a item to this model.
 void addChangeListener(ChangeListener l)
          Adds the listener.
 Object current()
          Returns current object.
 Object get(int index)
          Returns the item at the specified index.
 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.
 

Method Detail

current

Object current()
               throws NoSuchElementException
Returns current object.

Returns:
the current object
Throws:
NoSuchElementException

isEmpty

boolean isEmpty()
Determines the model is empty.

Returns:
true if the model is empty

hasNext

boolean hasNext()
Determines the model has next item.

Returns:
true if the model has next item

hasPrevious

boolean hasPrevious()
Determines the model has previous item.

Returns:
true if the model has previouse item

size

int size()
Returns the size of this model.

Returns:
the size

get

Object get(int index)
           throws IndexOutOfBoundsException
Returns the item at the specified index.

Parameters:
index - the index
Throws:
IndexOutOfBoundsException

add

void add(Object o)
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.

Parameters:
add - a item

getIndex

int getIndex()
Returns the index of current item.

Returns:
the index.
See Also:
setIndex(int)

setIndex

void setIndex(int index)
              throws IndexOutOfBoundsException
Sets the current index to the specifed index.

Parameters:
index - the index
Throws:
IndexOutOfBoundsException
See Also:
getIndex()

addChangeListener

void addChangeListener(ChangeListener l)
Adds the listener.

Parameters:
l - the listener

removeChangeListener

void removeChangeListener(ChangeListener l)
Removes the listener.

Parameters:
l - the listener

JComponentPack 1.5.0

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