Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.webapp.clipboard
Class SummaryImpl

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<String,SummaryEntry>
          extended by org.nuxeo.ecm.webapp.clipboard.SummaryImpl
All Implemented Interfaces:
Serializable, Cloneable, Map<String,SummaryEntry>, Summary

public class SummaryImpl
extends HashMap<String,SummaryEntry>
implements Summary, Serializable

This class is an implementation of the interface Summary. It intends to build and display a summary, thanks to summary items in the HashMap.

Author:
Brice Chaffangeon
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
SummaryImpl()
           
 
Method Summary
 String displayEntry(StringBuffer sb, SummaryEntry parentEntry)
          Displays recursively on entry.
 List<SummaryEntry> getChildren(SummaryEntry parentEntry)
           
 SummaryEntry getSummaryRoot()
          Gets the root SummaryEntry in the map, usually identified by a key in the map set to 0.
 boolean hasChild(SummaryEntry parentEntry)
          Tests if the given entry has at least one child in the map.
 String toFlatList()
          Display all the map in a flat way.
 String toString()
           
 String toTreeString()
          Displays all the map hierarchically.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

SummaryImpl

public SummaryImpl()
Method Detail

hasChild

public boolean hasChild(SummaryEntry parentEntry)
Description copied from interface: Summary
Tests if the given entry has at least one child in the map.

Specified by:
hasChild in interface Summary
Parameters:
parentEntry - is the entry to test
Returns:
true if there is at least one child

getChildren

public List<SummaryEntry> getChildren(SummaryEntry parentEntry)
Specified by:
getChildren in interface Summary
Parameters:
parentEntry - is parent of children you want to get
Returns:
all the children of the parentEntry in the List

displayEntry

public String displayEntry(StringBuffer sb,
                           SummaryEntry parentEntry)
Description copied from interface: Summary
Displays recursively on entry.

Specified by:
displayEntry in interface Summary
Parameters:
sb - is the String to display.
parentEntry - is the entry to display
Returns:
the String to display

toFlatList

public String toFlatList()
Description copied from interface: Summary
Display all the map in a flat way. The display is ordered by path.

Specified by:
toFlatList in interface Summary
Returns:
the string to display

toString

public String toString()
Overrides:
toString in class AbstractMap<String,SummaryEntry>
Returns:
the hierarchical view by default.

toTreeString

public String toTreeString()
Description copied from interface: Summary
Displays all the map hierarchically.

Specified by:
toTreeString in interface Summary
Returns:
the string to display

getSummaryRoot

public SummaryEntry getSummaryRoot()
Gets the root SummaryEntry in the map, usually identified by a key in the map set to 0.

Specified by:
getSummaryRoot in interface Summary
Returns:
the root SummaryEntry in the map

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.