Richard S. Hall | ddf2e14 | 2009-09-30 17:03:45 +0000 | [diff] [blame] | 1 | /* |
Richard S. Hall | 0b8e3ba | 2006-10-25 13:26:32 +0000 | [diff] [blame] | 2 | * 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. Hall | 44002cf | 2009-02-11 21:47:26 +0000 | [diff] [blame] | 19 | package org.apache.felix.log; |
Richard S. Hall | 0b8e3ba | 2006-10-25 13:26:32 +0000 | [diff] [blame] | 20 | |
| 21 | import org.osgi.service.log.LogEntry; |
| 22 | |
| 23 | /** |
| 24 | * The class used as a doubly linked list node in the log. |
| 25 | */ |
Richard S. Hall | ddf2e14 | 2009-09-30 17:03:45 +0000 | [diff] [blame] | 26 | final class LogNode |
| 27 | { |
Richard S. Hall | 0b8e3ba | 2006-10-25 13:26:32 +0000 | [diff] [blame] | 28 | /** The previous node. */ |
| 29 | private LogNode m_previous; |
Richard S. Hall | 0b8e3ba | 2006-10-25 13:26:32 +0000 | [diff] [blame] | 30 | /** The next node. */ |
| 31 | private LogNode m_next; |
Richard S. Hall | 0b8e3ba | 2006-10-25 13:26:32 +0000 | [diff] [blame] | 32 | /** 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. Hall | ddf2e14 | 2009-09-30 17:03:45 +0000 | [diff] [blame] | 39 | LogNode(final LogEntry entry) |
| 40 | { |
Richard S. Hall | 0b8e3ba | 2006-10-25 13:26:32 +0000 | [diff] [blame] | 41 | m_entry = entry; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Returns the associated entry. |
| 46 | * @return the associated entry |
| 47 | */ |
Richard S. Hall | ddf2e14 | 2009-09-30 17:03:45 +0000 | [diff] [blame] | 48 | LogEntry getEntry() |
| 49 | { |
Richard S. Hall | 0b8e3ba | 2006-10-25 13:26:32 +0000 | [diff] [blame] | 50 | return m_entry; |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Get the next node. |
| 55 | * @return the next node |
| 56 | */ |
Richard S. Hall | ddf2e14 | 2009-09-30 17:03:45 +0000 | [diff] [blame] | 57 | LogNode getNextNode() |
| 58 | { |
Richard S. Hall | 0b8e3ba | 2006-10-25 13:26:32 +0000 | [diff] [blame] | 59 | return m_next; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Set the next node. |
| 64 | * @param next the next node |
| 65 | */ |
Richard S. Hall | ddf2e14 | 2009-09-30 17:03:45 +0000 | [diff] [blame] | 66 | void setNextNode(final LogNode next) |
| 67 | { |
Richard S. Hall | 0b8e3ba | 2006-10-25 13:26:32 +0000 | [diff] [blame] | 68 | m_next = next; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Get the previous node. |
| 73 | * @return the previous node |
| 74 | */ |
Richard S. Hall | ddf2e14 | 2009-09-30 17:03:45 +0000 | [diff] [blame] | 75 | LogNode getPreviousNode() |
| 76 | { |
Richard S. Hall | 0b8e3ba | 2006-10-25 13:26:32 +0000 | [diff] [blame] | 77 | return m_previous; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Set the previous node. |
| 82 | * @param previous the previous node |
| 83 | */ |
Richard S. Hall | ddf2e14 | 2009-09-30 17:03:45 +0000 | [diff] [blame] | 84 | void setPreviousNode(final LogNode previous) |
| 85 | { |
Richard S. Hall | 0b8e3ba | 2006-10-25 13:26:32 +0000 | [diff] [blame] | 86 | m_previous = previous; |
| 87 | } |
Richard S. Hall | ddf2e14 | 2009-09-30 17:03:45 +0000 | [diff] [blame] | 88 | } |