Logo
Distributed Genetic Programming Framework
print print

File org.sfc.id.LeafHID.java

Here you can find all the information about the file org.sfc.id.LeafHID.java. You may explore it here or download it onto your local disk.
/*
 * Copyright (c) 2006 Thomas Weise
 * 
 * E-Mail           : tweise@gmx.de
 * Creation Date    : 2006-05-25 07:56:01
 * Original Filename: org.sfc.id.LeafHID.java
 * Version          : 1.0.0
 * Last modification: 2006-05-25
 *                by: Thomas Weise
 * 
 * License          : GNU LESSER GENERAL PUBLIC LICENSE
 *                    Version 2.1, February 1999
 *                    You should have received a copy of this license along
 *                    with this library; if not, write to the Free Software
 *                    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *                    MA 02111-1307, USA or download the license under
 *                    http://www.gnu.org/copyleft/lesser.html.
 *                    
 * Warranty         : This software is provided "as is" without any
 *                    warranty; without even the implied warranty of
 *                    merchantability or fitness for a particular purpose.
 *                    See the Gnu Lesser General Public License for more
 *                    details.
 */

 
package org.sfc.id;

import java.io.IOException;
import java.io.ObjectInputStream;

import org.sfc.utils.Typesafe;

/**
 * This class represents the leafs of the hid tree. 
 * 
 * @param <Type>    The type of the objects this sort of id will uniquely
 *                  be assigned to - classes or strings are common.
 * @param <IDType>  The type of this class.
 *
 * @author Thomas Weise
 */

public class LeafHID<Type, IDType extends LeafHID<Type, IDType>>
                                  extends ID<Type, IDType>
  {
/**
 * The serial version uid.
 */

  private static final long serialVersionUID = 1;
/**
 * The owning hierarchical identifier.
 */

          final     HID<?, Type, IDType, ?>    m_owner;
/**
 * The transient id manager.
 */

  private transient IDManager<Type, IDType>    m_manager  ;
  
/**
 * Create a new leaf hid.
 * @param p_owner   The owning hid.
 * @param p_id      The identifying object.
 */

  protected LeafHID (final HID<?, Type, IDType, ?>  p_owner,
                     final Type                     p_id)
    {
    super(p_id, p_owner.m_child_ids);
    this.m_owner   = p_owner;
    this.m_manager = Typesafe.cast(p_owner.m_child_ids);
    }
    
  
/**
 * Create a new leaf hid.
 * @param p_id      The identifying object.
 */

  LeafHID (final Type                  p_id)
    {
    super(p_id, false);
    this.m_owner   = null;
    this.m_manager = this.get_root_manager();
    this.m_manager.add_id(this);
    }

/**
 * Obtain the manager for the ids of this type.
 * @return  The manager for the ids of this type.
 */

  @Override
  protected final IDManager<Type, IDType> get_manager ()
    {
    return this.m_manager;
    }
  
/**
 * Obtain the manager for the ids of this type.
 * @return  The manager for the ids of this type.
 */

  IDManager<Type, IDType> get_root_manager ()
    {
    return Typesafe.cast(this.m_owner.m_child_ids);
    }
  
/**
 * Obtain the owning hid of this id.
 * @return The owning hid of this id.
 */

  protected final HID<?, Type, IDType, ?>  get_owner()
    {
    return this.m_owner;
    }
  
/**
 * Reconstitute the <code>SfcEvent</code> instance from a stream (that is,
 * deserialize it).
 * @param p_s The input stream.
 * @throws  IOException If something io-like went wrong.
 * @throws  ClassNotFoundException  If a needed class could not be found.
 */

  private final void readObject(final ObjectInputStream p_s)
        throws IOException, ClassNotFoundException
    { 
    p_s.defaultReadObject();    
    this.m_manager = this.get_root_manager(); 
    }
  }

File Information:

file name:LeafHID.java
package:org.sfc.id
qualified name:org.sfc.id.LeafHID.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/sfc/id/LeafHID.java
size:3.658 KB (3746 B)
uploaded: 2015-07-22 04:11:11 GMT+0000
last update: 2006-05-26 14:11:16 GMT+0000
last access: 2018-01-22 23:52:18 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2015-07-22 04:10:53 GMT+0000 served at 2018-01-22 23:52:18 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo