Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Product of NIST/ITL Advanced Networking Technologies Division (ANTD). * /
 
 
 package tools.tracesviewer;
 
 import java.util.*;

This class stores a sorted list messages for logging.

Author(s):
M. Ranganathan
Marc Bednarek
Version:
1.2
public class MessageLogList extends TreeSet {
    protected String description;
    protected static long startTime;
    static {
         = -1;
    }

    
Constructor.

Parameters:
comp comparator for sorting the logs
    public MessageLogList(Comparator comp) {
        super(comp);
    }

    
set a descriptive string for this log (for id purposes).

Parameters:
description is the decriptive string to add.
    public void addDescription(String description) {
        this. = description;
    }

    
Constructor given callId and a comparator.

Parameters:
callId is the call id for which to store the log.
comp is the comparator to sort the log records.
    public MessageLogList(String callIdComparator comp) {
        super(comp);
    }

    
Add a comparable object to the messgageLog

Parameters:
obj is the comparable object to add to the message log.
    public synchronized boolean add(Object obj) {
        TracesMessage log = (TracesMessageobj;
        long ts = Long.parseLong(log.getTime());
        if (ts <  ||  < 0)
             = ts;
        return super.add(obj);
    }
New to GrepCode? Check out our FAQ X