edu.cmu.sun.model
Class ListModel

java.lang.Object
  extended by edu.cmu.sun.model.ListModel

public class ListModel
extends java.lang.Object

A state model of a list of items that each represent a file in the filesystem. A ListModel is made up of a list of ItemModel components. This class doesn't do much except allow for some calls that make the design simpler for the ItemModel objects.

Author:
Braden Kowitz, Jake Pierson, Jessica Smith

Nested Class Summary
static class ListModel.Order
           
 
Field Summary
(package private)  FileNodeModel file
           
(package private)  java.util.List<ItemModel> items
           
(package private)  WindowModel windowModel
           
 
Constructor Summary
ListModel(FileNodeModel file)
           
 
Method Summary
 boolean containsItem(ItemModel parentItemModel)
           
private  void generateItems()
          generates ItemModels for this list.
 FileNodeModel getFile()
          returns the file that this list is based on.
 java.util.List<ItemModel> getItems()
           
 java.util.List<ItemModel> getItemsWithin(IndexRange range)
          Builds a list from the internal Items
 WindowModel getWindowModel()
          might return null if not set yet.
 void setItemOrder(ListModel.Order itemOrder)
           
 void setWindowModel(WindowModel model)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

FileNodeModel file

items

java.util.List<ItemModel> items

windowModel

WindowModel windowModel
Constructor Detail

ListModel

public ListModel(FileNodeModel file)
Method Detail

getFile

public FileNodeModel getFile()
returns the file that this list is based on.

Returns:

generateItems

private void generateItems()
generates ItemModels for this list.


setItemOrder

public void setItemOrder(ListModel.Order itemOrder)

getItems

public java.util.List<ItemModel> getItems()

getItemsWithin

public java.util.List<ItemModel> getItemsWithin(IndexRange range)
Builds a list from the internal Items

Parameters:
range -
Returns:
Throws:
IndexOutOfBoundsExcetion - if the range does not fit in the item list.

setWindowModel

public void setWindowModel(WindowModel model)

getWindowModel

public WindowModel getWindowModel()
might return null if not set yet.

Returns:

containsItem

public boolean containsItem(ItemModel parentItemModel)