Changeset 13535
- Timestamp:
- 2006-12-20T14:46:19+13:00 (17 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/Collection.java
r12589 r13535 127 127 } 128 128 129 /** Determine the path to the base collection.130 * @return the path as a String131 */132 public String getBaseCollection() {133 return getString(BASE_COLLECTION);134 }135 136 129 /** Determine the number of documents and folders in this collection. */ 137 130 public int getCount() { -
trunk/gli/src/org/greenstone/gatherer/util/ArrayTools.java
r8262 r13535 252 252 } 253 253 254 /** Method to convert a list of nodes from the DOM model into a node array. This is quite useful as using a <strong>NodeList</strong> is problematic if you wish to traverse the tree while editing. Because they are 'live' representations of the model you are editing, it is easy to drop out of for loops early or run off the ends of arrays. 255 * @param node_list A <strong>NodeList</strong> representing the <strong>Node</strong>s we want to iterate through. 256 * @return A brand new <strong>Node[]</strong> with the first <strong>Node</strong> in the <strong>NodeList</strong> at the head. 257 * @see org.w3c.dom.Node 258 * @see org.w3c.dom.NodeList 259 */ 260 static public Node[] nodeListToNodeArray(NodeList node_list) { 261 Node nodes[] = null; 262 for(int i = 0; i < node_list.getLength(); i++) { 263 nodes = add(nodes, node_list.item(i)); 264 } 265 return nodes; 266 } 254 267 255 /** Transforms an Object array into a single string of the form '[o1,o2,...,on]'. 268 256 * @param objects An <strong>Object[]</strong>. Note that the objects in this array must support toString() reasonably. -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r12621 r13535 383 383 384 384 385 /** I think this works a bit better on Unicode strings. */386 static public String stripNL(String raw_string)387 {388 StringBuffer stripped_string_buffer = new StringBuffer();389 for (int i = 0; i < raw_string.length(); i++) {390 char raw_character = raw_string.charAt(i);391 if (raw_character != '\n' && raw_character != '\t') {392 stripped_string_buffer.append(raw_character);393 }394 }395 return stripped_string_buffer.toString();396 }397 398 399 385 /** Builds the cache dir by appending the user path and 'cache'. 400 386 * @return a File representing the path to the private file cache within the current collection.
Note:
See TracChangeset
for help on using the changeset viewer.