001    /*
002     * Copyright 2001-2004 The Apache Software Foundation
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.apache.commons.cache.adt;
017    
018    /**
019     * A simple {@link Listable} supporting doubly-linked
020     * lists of arbitrary {@link Object}s.
021     *
022     * @version $Id: WListableObject.java 155435 2005-02-26 13:17:27Z dirkv $
023     * @author Rodney Waldhoff
024     */
025    public class WListableObject extends WListableBase implements Listable, Cloneable {
026      /**
027       * Equivalent to {@link #WListableObject(java.lang.Object,Listable,Listable) <tt>WListableObject(val,null,null)</tt>}.
028       */
029      public WListableObject(Object val) {
030        this(val,null,null);
031      }
032    
033      /**
034       * @param val my value
035       * @param next the next Listable.
036       */
037      public WListableObject(Object val, Listable prev, Listable next) {
038        super(prev,next);
039        _val = val;
040      }
041    
042      /** My value. */
043      protected Object _val = null;
044    
045      /**
046       * Return the {@link Object} I'm wrapping.
047       * @return the {@link Object} I'm wrapping.
048       */
049      public Object getValue() {
050        return _val;
051      }
052    
053      /**
054       * Set the {@link Object} I'm wrapping.
055       * @param the {@link Object} to wrap.
056       */
057      public void setValue(Object obj) {
058        _val = obj;
059      }
060    }