first commit

This commit is contained in:
2025-07-28 13:56:49 +05:30
commit e9eb805edb
3438 changed files with 520990 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
package net.sf.jasperreports.engine.util;
import java.util.LinkedList;
public class ThreadLocalStack {
private final ThreadLocal threadStack = new ThreadLocal();
public void push(Object o) {
LinkedList stack = this.threadStack.get();
if (stack == null) {
stack = new LinkedList();
this.threadStack.set(stack);
}
stack.addFirst(o);
}
public Object top() {
Object o = null;
LinkedList stack = this.threadStack.get();
if (stack != null && !stack.isEmpty())
o = stack.getFirst();
return o;
}
public Object pop() {
Object o = null;
LinkedList stack = this.threadStack.get();
if (stack != null)
o = stack.removeFirst();
return o;
}
public boolean empty() {
LinkedList stack = this.threadStack.get();
return (stack == null || stack.isEmpty());
}
}