blob: fe9b9e0083078c3676d6645640d5227b8d24e2b9 [file] [log] [blame]
Richard S. Hallddf2e142009-09-30 17:03:45 +00001/*
Richard S. Hall0b8e3ba2006-10-25 13:26:32 +00002 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
Richard S. Hall44002cf2009-02-11 21:47:26 +000019package org.apache.felix.log;
Richard S. Hall0b8e3ba2006-10-25 13:26:32 +000020
21import org.osgi.service.log.LogEntry;
22
23/**
24 * The class used as a doubly linked list node in the log.
25 */
Richard S. Hallddf2e142009-09-30 17:03:45 +000026final class LogNode
27{
Richard S. Hall0b8e3ba2006-10-25 13:26:32 +000028 /** The previous node. */
29 private LogNode m_previous;
Richard S. Hall0b8e3ba2006-10-25 13:26:32 +000030 /** The next node. */
31 private LogNode m_next;
Richard S. Hall0b8e3ba2006-10-25 13:26:32 +000032 /** The log entry. */
33 private final LogEntry m_entry;
34
35 /**
36 * Create a new instance.
37 * @param entry the log entry.
38 */
Richard S. Hallddf2e142009-09-30 17:03:45 +000039 LogNode(final LogEntry entry)
40 {
Richard S. Hall0b8e3ba2006-10-25 13:26:32 +000041 m_entry = entry;
42 }
43
44 /**
45 * Returns the associated entry.
46 * @return the associated entry
47 */
Richard S. Hallddf2e142009-09-30 17:03:45 +000048 LogEntry getEntry()
49 {
Richard S. Hall0b8e3ba2006-10-25 13:26:32 +000050 return m_entry;
51 }
52
53 /**
54 * Get the next node.
55 * @return the next node
56 */
Richard S. Hallddf2e142009-09-30 17:03:45 +000057 LogNode getNextNode()
58 {
Richard S. Hall0b8e3ba2006-10-25 13:26:32 +000059 return m_next;
60 }
61
62 /**
63 * Set the next node.
64 * @param next the next node
65 */
Richard S. Hallddf2e142009-09-30 17:03:45 +000066 void setNextNode(final LogNode next)
67 {
Richard S. Hall0b8e3ba2006-10-25 13:26:32 +000068 m_next = next;
69 }
70
71 /**
72 * Get the previous node.
73 * @return the previous node
74 */
Richard S. Hallddf2e142009-09-30 17:03:45 +000075 LogNode getPreviousNode()
76 {
Richard S. Hall0b8e3ba2006-10-25 13:26:32 +000077 return m_previous;
78 }
79
80 /**
81 * Set the previous node.
82 * @param previous the previous node
83 */
Richard S. Hallddf2e142009-09-30 17:03:45 +000084 void setPreviousNode(final LogNode previous)
85 {
Richard S. Hall0b8e3ba2006-10-25 13:26:32 +000086 m_previous = previous;
87 }
Richard S. Hallddf2e142009-09-30 17:03:45 +000088}