org.apache.logging.log4j
Class ThreadContext.ImmutableStack

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<String>
              extended by org.apache.logging.log4j.ThreadContext.ImmutableStack
All Implemented Interfaces:
Serializable, Cloneable, Iterable<String>, Collection<String>, List<String>, RandomAccess, ThreadContext.ContextStack
Enclosing class:
ThreadContext

public static class ThreadContext.ImmutableStack
extends ArrayList<String>

An immutable ContextStack.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ThreadContext.ImmutableStack()
           
ThreadContext.ImmutableStack(Collection<String> collection)
           
ThreadContext.ImmutableStack(org.apache.logging.log4j.ThreadContext.ThreadContextStack stack)
           
 
Method Summary
 void push(String message)
          Add an element to the stack.
 void trim(int depth)
          Trims elements from the end of the stack.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.logging.log4j.ThreadContext.ContextStack
clear
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

ThreadContext.ImmutableStack

public ThreadContext.ImmutableStack()

ThreadContext.ImmutableStack

public ThreadContext.ImmutableStack(Collection<String> collection)

ThreadContext.ImmutableStack

public ThreadContext.ImmutableStack(org.apache.logging.log4j.ThreadContext.ThreadContextStack stack)
Method Detail

push

public void push(String message)
Description copied from interface: ThreadContext.ContextStack
Add an element to the stack.

Specified by:
push in interface ThreadContext.ContextStack
Parameters:
message - The element to add.

trim

public void trim(int depth)
Description copied from interface: ThreadContext.ContextStack
Trims elements from the end of the stack.

Specified by:
trim in interface ThreadContext.ContextStack
Parameters:
depth - The maximum number of items in the stack to keep.


Copyright © 1999-2013 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.