it.unimo.dbgroup.momis.tools
Class DistanceMapSymmetrical

java.lang.Object
  extended byit.unimo.dbgroup.momis.tools.DistanceMap
      extended byit.unimo.dbgroup.momis.tools.DistanceMapSymmetrical
All Implemented Interfaces:
java.io.Serializable

public class DistanceMapSymmetrical
extends DistanceMap
implements java.io.Serializable

Symmetric Index container for Distance objects.
This class has been designed to handle Distances between objects and provides several ways to retrieve distances.
In this implementation distances are considered symmetrically. This means that d(a,b, 10) and (b,a, 20) are considered identical and mutually over-writing (the one replace the other in this indexing structure);
This choice allows handling of not directed graphs.
This class is based on a asymmetric DistanceMap class

Author:
Alberto Corni, July 2000
See Also:
Serialized Form

Field Summary
 
Fields inherited from class it.unimo.dbgroup.momis.tools.DistanceMap
 
Constructor Summary
DistanceMapSymmetrical()
          Indexes a set of Distance objects.
DistanceMapSymmetrical(Distance[] distances)
          Indexes a set of Distance objects.
DistanceMapSymmetrical(DistanceMap oldMap, java.util.Set preserve)
          Clonation method with filter.
DistanceMapSymmetrical(DistanceMapSymmetrical oldMap)
          Clonation method.
 
Method Summary
 void delete(java.lang.Object src, java.lang.Object dst)
          Removes from the indexing structure all distances from the given src and the given dst.
 Distance get(java.lang.Object src, java.lang.Object dst)
          Given source and destination object returns the Distance object between them .
static void main(java.lang.String[] args)
          Routine used to test the class.
 void put(Distance distance)
          Add a distance object in the indexing structure.
If a distance between the given elements already exists, it is substituted whith the new object.
 
Methods inherited from class it.unimo.dbgroup.momis.tools.DistanceMap
delete, getAllDistances, getEndingIn, getRelatedTo, getSetOfDestinationElements, getSetOfDistances, getSetOfElements, getSetOfSourceElements, getStartingFrom, putArray, putArrayRestricted, toString, toStringTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DistanceMapSymmetrical

public DistanceMapSymmetrical()
Indexes a set of Distance objects.


DistanceMapSymmetrical

public DistanceMapSymmetrical(Distance[] distances)
Indexes a set of Distance objects.

Parameters:
distances - Distance instance to be indexed.

DistanceMapSymmetrical

public DistanceMapSymmetrical(DistanceMapSymmetrical oldMap)
Clonation method.


DistanceMapSymmetrical

public DistanceMapSymmetrical(DistanceMap oldMap,
                              java.util.Set preserve)
Clonation method with filter.
The new DistanceMap will contain only the element specified in the preserve set.

Parameters:
oldMap - the DistanceMap to copy from.
preserve - the list of element to preserve.
Method Detail

put

public void put(Distance distance)
Add a distance object in the indexing structure.
If a distance between the given elements already exists, it is substituted whith the new object.

Overrides:
put in class DistanceMap
Parameters:
distance - The distance element to add to this indexing structure

get

public Distance get(java.lang.Object src,
                    java.lang.Object dst)
Given source and destination object returns the Distance object between them .

Overrides:
get in class DistanceMap
Returns:
the Distance object between the source and destination objects (remind this class is directional), null if such distance is not present.

delete

public void delete(java.lang.Object src,
                   java.lang.Object dst)
Removes from the indexing structure all distances from the given src and the given dst.

Overrides:
delete in class DistanceMap

main

public static void main(java.lang.String[] args)
Routine used to test the class.

Tests the tools.



Universita' di Modena e Reggio Emilia