model
Class DistanceSystem

java.lang.Object
  extended by model.DistanceSystem

public class DistanceSystem
extends java.lang.Object

Class for storing static data about qualitive distances.


Nested Class Summary
static class DistanceSystem.DistSystem
          a list of distance systems
static class DistanceSystem.Qldr2
           
static class DistanceSystem.Qldr3
           
static class DistanceSystem.Qldr4
           
static class DistanceSystem.Qldr5
           
 
Field Summary
private static java.util.HashMap<java.lang.String,java.lang.String> distanceHierarchy
          a mapping of distances to the next higher granularity
private static java.util.HashMap<java.lang.String,DistanceSystem.DistSystem> systemMap
          a mapping of distance names to their distance system
private static java.util.HashMap<DistanceSystem.DistSystem,java.util.ArrayList<java.lang.String>> valuesMap
          a mapping of systems to the distance names
 
Constructor Summary
DistanceSystem()
           
 
Method Summary
static java.lang.String getDistanceName(java.lang.String distanceName, DistanceSystem.DistSystem system)
          Gets the distance name of the specified distance in the new distance system.
static java.util.ArrayList<java.lang.String> getDistanceNames(DistanceSystem.DistSystem system)
          Gets the distance names for the specified system.
static DistanceSystem.DistSystem getSystem(java.lang.String distanceName)
          Gets the distance system for the specified distance name.
static boolean higherGranularity(DistanceSystem.DistSystem system1, DistanceSystem.DistSystem system2)
          Returns true if the first system has a higher granularity than the second system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

systemMap

private static java.util.HashMap<java.lang.String,DistanceSystem.DistSystem> systemMap
a mapping of distance names to their distance system


valuesMap

private static java.util.HashMap<DistanceSystem.DistSystem,java.util.ArrayList<java.lang.String>> valuesMap
a mapping of systems to the distance names


distanceHierarchy

private static java.util.HashMap<java.lang.String,java.lang.String> distanceHierarchy
a mapping of distances to the next higher granularity

Constructor Detail

DistanceSystem

public DistanceSystem()
Method Detail

getDistanceNames

public static java.util.ArrayList<java.lang.String> getDistanceNames(DistanceSystem.DistSystem system)
Gets the distance names for the specified system.

Parameters:
system - - the distance system
Returns:
- the distance values in the system

getSystem

public static DistanceSystem.DistSystem getSystem(java.lang.String distanceName)
Gets the distance system for the specified distance name.

Parameters:
distanceName - - the distance name
Returns:
- the distance system

getDistanceName

public static java.lang.String getDistanceName(java.lang.String distanceName,
                                               DistanceSystem.DistSystem system)
Gets the distance name of the specified distance in the new distance system. The new distance system must have a higher granularity than the current system of the distance name.

Parameters:
distanceName - - the distance name
system - - the new distance system
Returns:
- the distance name in the new distance system

higherGranularity

public static boolean higherGranularity(DistanceSystem.DistSystem system1,
                                        DistanceSystem.DistSystem system2)
Returns true if the first system has a higher granularity than the second system. Returns false if the first system is an equal of coarser granularity than the second system.

Parameters:
system1 - - the first system
system2 - - the second system
Returns:
- true if the first system has a higher granularity