Revision 1545
Added by Jing Tao over 21 years ago
src/edu/ucsb/nceas/metacat/MetaCatUtil.java | ||
---|---|---|
36 | 36 |
import java.util.PropertyResourceBundle; |
37 | 37 |
import java.util.Hashtable; |
38 | 38 |
import java.util.Enumeration; |
39 |
import java.util.Stack; |
|
39 | 40 |
import java.util.Vector; |
40 | 41 |
|
41 | 42 |
import edu.ucsb.nceas.dbadapter.AbstractDatabase; |
... | ... | |
491 | 492 |
return docidWithoutRev; |
492 | 493 |
|
493 | 494 |
} |
495 |
|
|
496 |
/** |
|
497 |
* Revise stack change a stack to opposite order |
|
498 |
*/ |
|
499 |
public static Stack reviseStack(Stack stack) |
|
500 |
{ |
|
501 |
Stack result = new Stack(); |
|
502 |
// make sure the parameter is correct |
|
503 |
if (stack == null || stack.isEmpty()) |
|
504 |
{ |
|
505 |
result = stack; |
|
506 |
return result; |
|
507 |
} |
|
508 |
|
|
509 |
while (!stack.isEmpty()) |
|
510 |
{ |
|
511 |
Object obj = stack.pop(); |
|
512 |
result.push(obj); |
|
513 |
} |
|
514 |
return result; |
|
515 |
} |
|
494 | 516 |
|
495 | 517 |
} |
Also available in: Unified diff
Add a method to revise a stack.