public static void setPreferredAttributeValueForTrafficDirection ( TrafficDirection direction , int index , String value ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { final StringBuilder keyName = new StringBuilder ( ) ; keyName . append ( "TRAFFIC_DIRECTION_VALUE_" ) ; //$NON-NLS-1$ keyName . append ( direction . name ( ) ) ; keyName . append ( "_" ) ; //$NON-NLS-1$ keyName . append ( index ) ; String sysDef ; try { sysDef = getSystemDefault ( direction , index ) ; } catch ( IndexOutOfBoundsException exception ) { sysDef = null ; } if ( value == null || "" . equals ( value ) //$NON-NLS-1$ || ( sysDef != null && sysDef . equalsIgnoreCase ( value ) ) ) { prefs . remove ( keyName . toString ( ) ) ; return ; } prefs . put ( keyName . toString ( ) , value ) ; } }
Set the preferred value of traffic direction used in the attributes for the traffic direction on the roads .