1 17 package org.alfresco.filesys.server.filesys; 18 19 24 public abstract class SearchContext 25 { 26 27 29 private int m_maxFiles; 30 31 33 private int m_treeId; 34 35 37 private String m_searchStr; 38 39 41 private int m_flags; 42 43 46 public SearchContext() 47 { 48 } 49 50 56 protected SearchContext(int maxFiles, int treeId) 57 { 58 m_maxFiles = maxFiles; 59 m_treeId = treeId; 60 } 61 62 65 public void closeSearch() 66 { 67 } 68 69 74 public final int getFlags() 75 { 76 return m_flags; 77 } 78 79 84 public final int getMaximumFiles() 85 { 86 return m_maxFiles; 87 } 88 89 94 public abstract int getResumeId(); 95 96 101 public final String getSearchString() 102 { 103 return m_searchStr != null ? m_searchStr : ""; 104 } 105 106 111 public final int getTreeId() 112 { 113 return m_treeId; 114 } 115 116 121 public abstract boolean hasMoreFiles(); 122 123 130 public abstract boolean nextFileInfo(FileInfo info); 131 132 138 public abstract String nextFileName(); 139 140 145 public int numberOfEntries() 146 { 147 return -1; 148 } 149 150 156 public abstract boolean restartAt(int resumeId); 157 158 164 public abstract boolean restartAt(FileInfo info); 165 166 171 public final void setFlags(int flg) 172 { 173 m_flags = flg; 174 } 175 176 181 public final void setMaximumFiles(int maxFiles) 182 { 183 m_maxFiles = maxFiles; 184 } 185 186 191 public final void setSearchString(String str) 192 { 193 m_searchStr = str; 194 } 195 196 201 public final void setTreeId(int id) 202 { 203 m_treeId = id; 204 } 205 206 211 public String toString() 212 { 213 StringBuffer str = new StringBuffer (); 214 str.append("["); 215 str.append(getSearchString()); 216 str.append(":"); 217 str.append(getMaximumFiles()); 218 str.append(","); 219 str.append("0x"); 220 str.append(Integer.toHexString(getFlags())); 221 str.append("]"); 222 223 return str.toString(); 224 } 225 } | Popular Tags |