org.enhydra.barracuda.contrib.sam.models
Class IteratorModel

java.lang.Object
  extended byorg.enhydra.barracuda.core.comp.AbstractTemplateModel
      extended byorg.enhydra.barracuda.core.comp.AbstractIterativeTemplateModel
          extended byorg.enhydra.barracuda.contrib.sam.models.IteratorModel
All Implemented Interfaces:
Contextual, IterativeModel, Model, TemplateModel
Direct Known Subclasses:
IterativeMapModel, IterativeSubModel

public abstract class IteratorModel
extends AbstractIterativeTemplateModel

iterates over a Map, uses the special keys "Key" and "Value" for returning key-value-pairs

Version:
$Id: IteratorModel.java,v 1.4 2004/02/01 05:16:27 christianc Exp $
Author:
Stefan Armbruster

Field Summary
protected  Object _current
          current element during iteration, might be casted to appropiate class
protected  Iterator _iter
           
protected static org.apache.log4j.Logger logger
           
protected  String name
          name of the model
 
Fields inherited from class org.enhydra.barracuda.core.comp.AbstractTemplateModel
listeners, UNDEFINED, viewContext
 
Constructor Summary
IteratorModel(String name)
           
IteratorModel(String name, Iterator iter)
          initialize the model
 
Method Summary
 String getName()
          get the name of the model
 boolean hasNext()
           
 void loadNext()
          empty implementation, does nothing.
 void setIterator(Iterator iter)
           
 void setName(String name)
          set the name of the model
 
Methods inherited from class org.enhydra.barracuda.core.comp.AbstractIterativeTemplateModel
postIterate, preIterate
 
Methods inherited from class org.enhydra.barracuda.core.comp.AbstractTemplateModel
addModelListener, fireModelChanged, getItem, getItem, getViewContext, processDirective, removeModelListener, setViewContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

name

protected String name
name of the model


_iter

protected Iterator _iter

_current

protected Object _current
current element during iteration, might be casted to appropiate class

Constructor Detail

IteratorModel

public IteratorModel(String name,
                     Iterator iter)
initialize the model

Parameters:
name - Name of the model
iter - Iterator to iterate

IteratorModel

public IteratorModel(String name)
Method Detail

getName

public String getName()
get the name of the model

Returns:
name of the model

setIterator

public void setIterator(Iterator iter)

setName

public void setName(String name)
set the name of the model

Parameters:
name - name of the model

hasNext

public boolean hasNext()
Specified by:
hasNext in interface IterativeModel
Specified by:
hasNext in class AbstractIterativeTemplateModel

loadNext

public void loadNext()
empty implementation, does nothing. Only reason for being here is to fully implement IterativeModel.

Specified by:
loadNext in interface IterativeModel
Specified by:
loadNext in class AbstractIterativeTemplateModel


Copyright © 2003 BarracudaMVC.org All Rights Reserved.