1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.debug.core.logview;
13 import java.text.ParseException;
14 import java.text.SimpleDateFormat;
15 import java.util.Date;
16 import java.util.StringTokenizer;
18 public class LogSession {
19 private String sessionData;
23 * Constructor for LogSession.
28 public Date getDate() {
32 public void setDate(String dateString) {
33 SimpleDateFormat formatter = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss.SS"); //$NON-NLS-1$
35 date = formatter.parse(dateString);
36 } catch (ParseException e) {
40 public String getSessionData() {
44 void setSessionData(String data) {
45 this.sessionData = data;
48 public void processLogLine(String line) {
49 StringTokenizer tokenizer = new StringTokenizer(line);
50 if (tokenizer.countTokens() == 6) {
51 tokenizer.nextToken();
52 StringBuffer dateBuffer = new StringBuffer();
53 for (int i = 0; i < 4; i++) {
54 dateBuffer.append(tokenizer.nextToken());
55 dateBuffer.append(" "); //$NON-NLS-1$
57 setDate(dateBuffer.toString().trim());