All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.tsl2.nano.vnet.Link Maven / Gradle / Ivy

Go to download

TSL2 Framework VirtualNetwork (Generic parallelized Network-Mechanism providing implementations for: NeuronalNetwork, Routing, Workflow)

There is a newer version: 2.5.4b
Show newest version
/*
 * File: $HeadURL$
 * Id  : $Id$
 * 
 * created by: Thomas Schneider, Thomas Schneider
 * created on: Dec 7, 2012
 * 
 * Copyright: (c) Thomas Schneider 2012, all rights reserved
 */
package de.tsl2.nano.vnet;

import java.io.Serializable;

import de.tsl2.nano.structure.Cover;

/**
 * Technical base definition to link an item to a {@link #getDestination()}. The link properties are defined by the
 * {@link #descriptor}. May be used as base for Wrappers, Pointers or Connections.
 * 

* A source item will hold this link to the destination. Implementing all java-standard interfaces like * {@link Serializable}, {@link Comparable}, {@link Cloneable} and the methods {@link Object#hashCode()}, * {@link Object#equals(Object)}, you may use this class to extend your class with some properties (defined by the * descriptor). *

* An example use case would be to add a weight to your class, using that weight to be sorted and compared. *

* * @author Thomas Schneider, Thomas Schneider * @version $Revision$ */ public class Link, D extends Comparable> extends Cover { /** serialVersionUID */ private static final long serialVersionUID = -2576925075573766918L; /** * constructor * * @param destination {@link #destination} * @param descriptor {@link #descriptor} */ public Link(T destination, D descriptor) { super(destination, descriptor); } /** * @return Returns the destination. */ public T getDestination() { return content; } /** * @param destination The destination to set. */ public void setDestination(T destination) { assert destination != null; this.content = destination; } /** * {@inheritDoc} */ @Override public String toString() { return "={" + descriptor + "}=> " + content; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy