1 17 package org.alfresco.filesys.smb.server.ntfs; 18 19 import java.util.Vector ; 20 21 24 public class StreamInfoList 25 { 26 27 29 private Vector <StreamInfo> m_list; 30 31 34 public StreamInfoList() 35 { 36 m_list = new Vector <StreamInfo>(); 37 } 38 39 44 public final void addStream(StreamInfo info) 45 { 46 m_list.add(info); 47 } 48 49 55 public final StreamInfo getStreamAt(int idx) 56 { 57 58 60 if (idx < 0 || idx >= m_list.size()) 61 return null; 62 63 65 return m_list.get(idx); 66 } 67 68 74 public final StreamInfo findStream(String name) 75 { 76 77 79 for (int i = 0; i < m_list.size(); i++) 80 { 81 82 84 StreamInfo sinfo = m_list.get(i); 85 86 88 if (sinfo.getName().equals(name)) 89 return sinfo; 90 } 91 92 94 return null; 95 } 96 97 102 public final int numberOfStreams() 103 { 104 return m_list.size(); 105 } 106 107 113 public final StreamInfo removeStream(int idx) 114 { 115 116 118 if (idx < 0 || idx >= m_list.size()) 119 return null; 120 121 123 return m_list.remove(idx); 124 } 125 126 132 public final StreamInfo removeStream(String name) 133 { 134 135 137 for (int i = 0; i < m_list.size(); i++) 138 { 139 140 142 StreamInfo sinfo = m_list.get(i); 143 144 146 if (sinfo.getName().equals(name)) 147 { 148 149 151 m_list.removeElementAt(i); 152 return sinfo; 153 } 154 } 155 156 158 return null; 159 } 160 161 164 public final void removeAllStreams() 165 { 166 m_list.removeAllElements(); 167 } 168 } 169 | Popular Tags |