001    package edu.jhu.mb.ernst.model.synapse;
002
003    import edu.jhu.mb.ernst.model.Synapse;
004    
005    /***********************************************************************
006    * Static method library to manipulate Synapse instances.
007    * 
008    * @version
009    *   $Date: 2012-04-15 13:06:25 -0500 (Sun, 15 Apr 2012) $
010    *   $Rev: 7 $
011    *   $Author: croft $
012    * @since
013    *   2012-02-19
014    * @author
015    *   David Wallace Croft
016    ***********************************************************************/
017    public final class  SynapseLib
018    ////////////////////////////////////////////////////////////////////////
019    ////////////////////////////////////////////////////////////////////////
020    {
021    
022    public static int  compareTo (
023      final Synapse  synapse0,
024      final Synapse  synapse1 )
025    ////////////////////////////////////////////////////////////////////////
026    {
027      final int
028        targetNeuronIndex0 = synapse0.getTargetNeuronIndex ( ),
029        targetNeuronIndex1 = synapse1.getTargetNeuronIndex ( );
030      
031      if ( targetNeuronIndex0 < targetNeuronIndex1 )
032      {
033        return -1;
034      }
035      
036      if ( targetNeuronIndex0 > targetNeuronIndex1 )
037      {
038        return 1;
039      }
040      
041      return 0;
042    }
043    
044    public static String  toString ( final Synapse  synapse )
045    ////////////////////////////////////////////////////////////////////////
046    {
047      return "To:" + synapse.getTargetNeuronIndex ( )
048        + " Weight:" + synapse.getWeight ( )
049        + " Type:" + synapse.getType ( );
050    }    
051    
052    ////////////////////////////////////////////////////////////////////////
053    ////////////////////////////////////////////////////////////////////////
054    
055    private  SynapseLib ( )
056    ////////////////////////////////////////////////////////////////////////
057    {
058      // private constructor
059    }
060    
061    ////////////////////////////////////////////////////////////////////////
062    ////////////////////////////////////////////////////////////////////////
063    }