edu.wisc.my.portlets.bookmarks.domain
Class Folder

java.lang.Object
  extended by edu.wisc.my.portlets.bookmarks.domain.Entry
      extended by edu.wisc.my.portlets.bookmarks.domain.Folder
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BookmarkSet

public class Folder
extends Entry

A Folder can contain other entries in a List. This is a basic bean and no defensive copying is done. Changes made to List returned by getChildren() will be reflected to other code using these APIs.

Version:
$Revision: 12155 $
Author:
Eric Dalquist eric.dalquist@doit.wisc.edu
See Also:
Serialized Form

Constructor Summary
Folder()
           
 
Method Summary
 boolean equals(java.lang.Object object)
           
 java.util.Comparator<Entry> getChildComparator()
           
 java.util.Map<java.lang.Long,Entry> getChildren()
           
 java.util.List<Entry> getSortedChildren()
          Returns an immutable sorted view of the values of the children Map.
 int hashCode()
           
 boolean isMinimized()
           
 void setChildComparator(java.util.Comparator<Entry> childComparator)
           
 void setChildren(java.util.Map<java.lang.Long,Entry> children)
           
 void setMinimized(boolean minimized)
           
 java.lang.String toString()
           
 
Methods inherited from class edu.wisc.my.portlets.bookmarks.domain.Entry
getCreated, getId, getModified, getName, getNote, getNoteLines, setCreated, setId, setModified, setName, setNote
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Folder

public Folder()
Method Detail

getChildren

public java.util.Map<java.lang.Long,Entry> getChildren()
Returns:
Returns the children, will never return null.

setChildren

public void setChildren(java.util.Map<java.lang.Long,Entry> children)
Parameters:
children - The children to set.

isMinimized

public boolean isMinimized()
Returns:
Returns the minimized.

setMinimized

public void setMinimized(boolean minimized)
Parameters:
minimized - The minimized to set.

getSortedChildren

public java.util.List<Entry> getSortedChildren()
Returns an immutable sorted view of the values of the children Map. The sorting is done using the current childComparator. Warning, this is has a time cost of 2n log(n) on every call.

Returns:
An immutable sorted view of the folder's children.

getChildComparator

public java.util.Comparator<Entry> getChildComparator()
Returns:
Returns the childComparator.

setChildComparator

public void setChildComparator(java.util.Comparator<Entry> childComparator)
Parameters:
childComparator - The childComparator to set, calls setChildComparator on all children of type Folder.

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class Entry
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Entry
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class Entry
See Also:
Object.toString()


Copyright © 1998-2007 Java Architectures Special Interest Group. All Rights Reserved.