1 17 package org.alfresco.filesys.server.filesys; 18 19 import java.util.Enumeration ; 20 import java.util.Hashtable ; 21 22 28 public class TreeConnectionHash 29 { 30 31 33 private Hashtable <Integer , TreeConnection> m_connections; 34 35 38 public TreeConnectionHash() 39 { 40 m_connections = new Hashtable <Integer , TreeConnection>(); 41 } 42 43 48 public final int numberOfEntries() 49 { 50 return m_connections.size(); 51 } 52 53 58 public final void addConnection(TreeConnection tree) 59 { 60 m_connections.put(tree.getSharedDevice().getName().hashCode(), tree); 61 } 62 63 69 public final TreeConnection deleteConnection(String shareName) 70 { 71 return (TreeConnection) m_connections.get(shareName.hashCode()); 72 } 73 74 80 public final TreeConnection findConnection(String shareName) 81 { 82 83 85 TreeConnection tree = m_connections.get(shareName.hashCode()); 86 87 89 return tree; 90 } 91 92 98 public final TreeConnection findConnection(int hashCode) 99 { 100 101 103 TreeConnection tree = m_connections.get(hashCode); 104 105 107 return tree; 108 } 109 110 115 public final Enumeration <TreeConnection> enumerateConnections() 116 { 117 return m_connections.elements(); 118 } 119 } 120 | Popular Tags |