Package org.apache.commons.net.nntp
Class Threader
- java.lang.Object
-
- org.apache.commons.net.nntp.Threader
-
public class Threader extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Threader()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
buildContainer(Threadable threadable, java.util.HashMap<java.lang.String,ThreadContainer> idTable)
private ThreadContainer
findRootSet(java.util.HashMap<java.lang.String,ThreadContainer> idTable)
Find the root set of all existing ThreadContainersprivate void
gatherSubjects(ThreadContainer root)
If any two members of the root set have the same subject, merge them.private void
pruneEmptyContainers(ThreadContainer parent)
Delete any empty or dummy ThreadContainersThreadable
thread(java.lang.Iterable<? extends Threadable> messages)
The client passes in a list of Iterable objects, and the Threader constructs a connected 'graph' of messagesThreadable
thread(java.util.List<? extends Threadable> messages)
The client passes in a list of Threadable objects, and the Threader constructs a connected 'graph' of messagesThreadable
thread(Threadable[] messages)
Deprecated.(2.2) preferthread(List)
-
-
-
Method Detail
-
thread
public Threadable thread(java.util.List<? extends Threadable> messages)
The client passes in a list of Threadable objects, and the Threader constructs a connected 'graph' of messages- Parameters:
messages
- list of messages to thread, must not be empty- Returns:
- null if messages == null or root.child == null or messages list is empty
- Since:
- 2.2
-
thread
public Threadable thread(java.lang.Iterable<? extends Threadable> messages)
The client passes in a list of Iterable objects, and the Threader constructs a connected 'graph' of messages- Parameters:
messages
- iterable of messages to thread, must not be empty- Returns:
- null if messages == null or root.child == null or messages list is empty
- Since:
- 3.0
-
buildContainer
private void buildContainer(Threadable threadable, java.util.HashMap<java.lang.String,ThreadContainer> idTable)
- Parameters:
threadable
-idTable
-
-
findRootSet
private ThreadContainer findRootSet(java.util.HashMap<java.lang.String,ThreadContainer> idTable)
Find the root set of all existing ThreadContainers- Parameters:
idTable
-- Returns:
- root the ThreadContainer representing the root node
-
pruneEmptyContainers
private void pruneEmptyContainers(ThreadContainer parent)
Delete any empty or dummy ThreadContainers- Parameters:
parent
-
-
gatherSubjects
private void gatherSubjects(ThreadContainer root)
If any two members of the root set have the same subject, merge them. This is to attempt to accomodate messages without References: headers.- Parameters:
root
-
-
thread
@Deprecated public Threadable thread(Threadable[] messages)
Deprecated.(2.2) preferthread(List)
The client passes in an array of Threadable objects, and the Threader constructs a connected 'graph' of messages- Parameters:
messages
- array of messages to thread, must not be empty- Returns:
- null if messages == null or root.child == null or messages array is empty
-
-