1 31 32 package org.opencms.staticexport; 33 34 import java.util.HashMap ; 35 import java.util.Iterator ; 36 37 46 public class CmsLinkTable { 47 48 49 private static final String LINK_PREFIX = "link"; 50 51 52 private HashMap m_linkTable; 53 54 57 public CmsLinkTable() { 58 59 m_linkTable = new HashMap (); 60 } 61 62 68 public CmsLink addLink(CmsLink link) { 69 70 m_linkTable.put(link.getName(), link); 71 return link; 72 } 73 74 82 public CmsLink addLink(String type, String targetUri, boolean internal) { 83 84 CmsLink link = new CmsLink(LINK_PREFIX + m_linkTable.size(), type, targetUri, internal); 85 m_linkTable.put(link.getName(), link); 86 return link; 87 } 88 89 95 public CmsLink getLink(String name) { 96 97 return (CmsLink)m_linkTable.get(name); 98 } 99 100 105 public boolean isEmpty() { 106 107 return m_linkTable.isEmpty(); 108 } 109 110 117 public Iterator iterator() { 118 119 return m_linkTable.values().iterator(); 120 } 121 122 127 public int size() { 128 129 return m_linkTable.size(); 130 } 131 } 132 | Popular Tags |