idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
6,200
public static Function < EREEventMention , TYPE > typeFunction ( ) { return new Function < EREEventMention , TYPE > ( ) { public TYPE apply ( final EREEventMention input ) { return input . getType ( ) ; } } ; }
guava style functions
6,201
public static Object displayURLonStandardBrowser ( final Component parentComponent , final String url ) { Object obj = null ; try { if ( System . getProperty ( SYSTEM_PROPERTY_OS_NAME ) . startsWith ( OS . MAC . getOs ( ) ) ) { obj = openURLinMacOS ( url ) ; } else if ( System . getProperty ( SYSTEM_PROPERTY_OS_NAME ) ...
This method opens the specified url in the standard web - browser .
6,202
private static Object openURLinMacOS ( final String url ) throws ClassNotFoundException , NoSuchMethodException , IllegalAccessException , InvocationTargetException { final Class < ? > fileManagerClass = Class . forName ( MAC_FILE_MANAGER ) ; final Method openURL = fileManagerClass . getDeclaredMethod ( "openURL" , new...
Opens the given URL in mac os .
6,203
private static Boolean openURLinUnixOS ( final String url ) throws InterruptedException , IOException , Exception { Boolean executed = false ; for ( final Browsers browser : Browsers . values ( ) ) { if ( ! executed ) { executed = Runtime . getRuntime ( ) . exec ( new String [ ] { UNIX_COMMAND_WHICH , browser . getBrow...
Opens the given URL in unix os .
6,204
private static Process openURLinWindowsOS ( final String url ) throws IOException { String cmd = null ; cmd = WINDOWS_PATH + " " + WINDOWS_FLAG + " " ; return Runtime . getRuntime ( ) . exec ( cmd + url ) ; }
Opens the given URL in windows os .
6,205
protected void onInitializeGroupLayout ( ) { javax . swing . GroupLayout layout = new javax . swing . GroupLayout ( this ) ; this . setLayout ( layout ) ; layout . setHorizontalGroup ( layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( layout . createSequentialGroup ( ) . ad...
On initialize group layout .
6,206
public static void displayVersionInfo ( String command ) { String version = ProxyInitStrategy . class . getPackage ( ) . getImplementationVersion ( ) ; if ( version == null ) { version = "N/A" ; } System . out . format ( "%s v. %s (%s)\n" , command , version , getAPIVersionString ( ) ) ; }
Display version information .
6,207
public static boolean intersectsOrientedBoxCapsule ( double centerx , double centery , double centerz , double axis1x , double axis1y , double axis1z , double axis2x , double axis2y , double axis2z , double axis3x , double axis3y , double axis3z , double extentAxis1 , double extentAxis2 , double extentAxis3 , double ca...
Compute intersection between an OBB and a capsule .
6,208
public void setFromPointCloud ( Iterable < ? extends Point3D > pointCloud ) { Vector3f r = new Vector3f ( ) ; Vector3f s = new Vector3f ( ) ; Vector3f t = new Vector3f ( ) ; Point3f c = new Point3f ( ) ; double [ ] extents = new double [ 3 ] ; computeOBBCenterAxisExtents ( pointCloud , r , s , t , c , extents ) ; set (...
Set the oriented box from a could of points .
6,209
public void rotate ( Quaternion rotation ) { Transform3D m = new Transform3D ( ) ; m . transform ( this . getFirstAxis ( ) ) ; m . transform ( this . getSecondAxis ( ) ) ; m . transform ( this . getThirdAxis ( ) ) ; this . setFirstAxisExtent ( this . getFirstAxis ( ) . length ( ) ) ; this . setSecondAxisExtent ( this ....
Rotate the box around its pivot point . The pivot point is the center of the box .
6,210
public void rotate ( Quaternion rotation , Point3D pivot ) { if ( pivot != null ) { Transform3D m1 = new Transform3D ( ) ; m1 . setTranslation ( - pivot . getX ( ) , - pivot . getY ( ) , - pivot . getZ ( ) ) ; Transform3D m2 = new Transform3D ( ) ; m2 . setRotation ( rotation ) ; Transform3D m3 = new Transform3D ( ) ; ...
Rotate the box around a given pivot point . The default pivot point of the center of the box .
6,211
protected void definePath ( ZoomableGraphicsContext gc , T element ) { gc . beginPath ( ) ; final PathIterator2afp < PathElement2d > pathIterator = element . toPath2D ( ) . getPathIterator ( ) ; switch ( pathIterator . getWindingRule ( ) ) { case EVEN_ODD : gc . setFillRule ( FillRule . EVEN_ODD ) ; break ; case NON_ZE...
Draw the polyline path .
6,212
public static String getFirstFreeBusStopName ( BusNetwork busNetwork ) { if ( busNetwork == null ) { return null ; } int nb = busNetwork . getBusStopCount ( ) ; String name ; do { ++ nb ; name = Locale . getString ( "NAME_TEMPLATE" , Integer . toString ( nb ) ) ; } while ( busNetwork . getBusStop ( name ) != null ) ; r...
Replies a bus stop name that was not exist in the specified bus network .
6,213
private void notifyDependencies ( ) { if ( getContainer ( ) != null ) { for ( final BusHub hub : busHubs ( ) ) { hub . checkPrimitiveValidity ( ) ; } for ( final BusItineraryHalt halt : getBindedBusHalts ( ) ) { halt . checkPrimitiveValidity ( ) ; } } }
Notifies any dependent object about a validation change from this bus stop .
6,214
public void setPosition ( GeoLocationPoint position ) { if ( ( this . position == null && position != null ) || ( this . position != null && ! this . position . equals ( position ) ) ) { this . position = position ; fireShapeChanged ( ) ; checkPrimitiveValidity ( ) ; } }
Set the position of the element .
6,215
public double distance ( double x , double y ) { if ( isValidPrimitive ( ) ) { final GeoLocationPoint p = getGeoPosition ( ) ; return Point2D . getDistancePointPoint ( p . getX ( ) , p . getY ( ) , x , y ) ; } return Double . NaN ; }
Replies the distance between the given point and this bus stop .
6,216
public double distance ( BusStop stop ) { if ( isValidPrimitive ( ) && stop . isValidPrimitive ( ) ) { final GeoLocationPoint p = getGeoPosition ( ) ; final GeoLocationPoint p2 = stop . getGeoPosition ( ) ; return Point2D . getDistancePointPoint ( p . getX ( ) , p . getY ( ) , p2 . getX ( ) , p2 . getY ( ) ) ; } return...
Replies the distance between the given bus stop and this bus stop .
6,217
void addBusHub ( BusHub hub ) { if ( this . hubs == null ) { this . hubs = new WeakArrayList < > ( ) ; } this . hubs . add ( hub ) ; }
Add a hub reference .
6,218
void removeBusHub ( BusHub hub ) { if ( this . hubs != null ) { this . hubs . remove ( hub ) ; if ( this . hubs . isEmpty ( ) ) { this . hubs = null ; } } }
Remove a hub reference .
6,219
void addBusHalt ( BusItineraryHalt halt ) { if ( this . halts == null ) { this . halts = new WeakArrayList < > ( ) ; } this . halts . add ( halt ) ; }
Add a bus halt reference .
6,220
void removeBusHalt ( BusItineraryHalt halt ) { if ( this . halts != null ) { this . halts . remove ( halt ) ; if ( this . halts . isEmpty ( ) ) { this . halts = null ; } } }
Remove a bus halt reference .
6,221
public Iterable < BusItineraryHalt > getBindedBusHalts ( ) { if ( this . halts == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableCollection ( this . halts ) ; }
Replies the bus itinerary halts associated to this bus stop .
6,222
public static Vector2ifx convert ( Tuple2D < ? > tuple ) { if ( tuple instanceof Vector2ifx ) { return ( Vector2ifx ) tuple ; } return new Vector2ifx ( tuple . getX ( ) , tuple . getY ( ) ) ; }
Convert the given tuple to a real Vector2ifx .
6,223
public static int compareAttrs ( Attribute arg0 , Attribute arg1 ) { if ( arg0 == arg1 ) { return 0 ; } if ( arg0 == null ) { return 1 ; } if ( arg1 == null ) { return - 1 ; } final String n0 = arg0 . getName ( ) ; final String n1 = arg1 . getName ( ) ; final int cmp = compareAttrNames ( n0 , n1 ) ; if ( cmp == 0 ) { r...
Compare the two specified attributes .
6,224
public static int compareAttrNames ( String arg0 , String arg1 ) { if ( arg0 == arg1 ) { return 0 ; } if ( arg0 == null ) { return Integer . MAX_VALUE ; } if ( arg1 == null ) { return Integer . MIN_VALUE ; } return arg0 . compareToIgnoreCase ( arg1 ) ; }
Compare the two specified attribute names .
6,225
public boolean isTemporaryChange ( ) { final Object src = getSource ( ) ; if ( src instanceof MapLayer ) { return ( ( MapLayer ) src ) . isTemporaryLayer ( ) ; } return false ; }
Replies if the change in the layer was marked as temporary . The usage of this information depends on the listener s behaviour .
6,226
protected final Graph < ST , PT > getParentGraph ( ) { return this . parentGraph == null ? null : this . parentGraph . get ( ) ; }
Replies the parent graph is this subgraph was built .
6,227
public final void build ( GraphIterator < ST , PT > iterator , SubGraphBuildListener < ST , PT > listener ) { assert iterator != null ; final Set < ComparableWeakReference < PT > > reachedPoints = new TreeSet < > ( ) ; GraphIterationElement < ST , PT > element ; ST segment ; PT point ; PT firstPoint = null ; this . par...
Build a subgraph from the specified graph .
6,228
public List < Object > getAddedValues ( ) { if ( this . newValues == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableList ( this . newValues ) ; }
Replies the list of added data .
6,229
public List < Object > getRemovedValues ( ) { if ( this . oldValues == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableList ( this . oldValues ) ; }
Replies the list of removed data .
6,230
public List < Object > getCurrentValues ( ) { if ( this . allValues == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableList ( this . allValues ) ; }
Replies the list of current data .
6,231
public static < A , B > ImmutableMultiset < B > transformedCopy ( Multiset < A > ms , Function < A , B > func ) { final ImmutableMultiset . Builder < B > ret = ImmutableMultiset . builder ( ) ; for ( final Multiset . Entry < A > entry : ms . entrySet ( ) ) { final B transformedElement = func . apply ( entry . getElemen...
Returns a new Multiset resulting from transforming each element of the input Multiset by a function . If two or more elements are mapped to the same value by the function their counts will be summed in the new Multiset .
6,232
public static < A , B > Multiset < B > mutableTransformedCopy ( Multiset < A > ms , Function < A , B > func ) { final Multiset < B > ret = HashMultiset . create ( ) ; for ( final Multiset . Entry < A > entry : ms . entrySet ( ) ) { final B transformedElement = func . apply ( entry . getElement ( ) ) ; ret . add ( trans...
Same as transformedCopy except the returned Multiset is mutable .
6,233
public static boolean allSameSize ( List < Collection < ? > > collections ) { if ( collections . isEmpty ( ) ) { return true ; } final int referenceSize = collections . get ( 0 ) . size ( ) ; for ( final Collection < ? > col : collections ) { if ( col . size ( ) != referenceSize ) { return false ; } } return true ; }
Returns true if and only if all the collections in the provided list have the same size . Returns true if the provided list is empty .
6,234
public static < T > List < T > coerceNullToEmpty ( List < T > list ) { return MoreObjects . firstNonNull ( list , ImmutableList . < T > of ( ) ) ; }
Turns null into an empty list and leaves other inputs untouched .
6,235
protected void update ( DocumentEvent event ) { String text ; try { text = event . getDocument ( ) . getText ( event . getDocument ( ) . getStartPosition ( ) . getOffset ( ) , event . getDocument ( ) . getEndPosition ( ) . getOffset ( ) - 1 ) ; model . setObject ( text ) ; } catch ( BadLocationException e1 ) { log . lo...
Update the underlying model object .
6,236
public static String makeAndroidApplicationName ( String applicationName ) { final String fullName ; if ( applicationName . indexOf ( '.' ) >= 0 ) { fullName = applicationName ; } else { fullName = "org.arakhne.partnership." + applicationName ; } return fullName ; }
Make a valid android application name from the given application name . A valid android application name is a package name followed by the name of the application .
6,237
public static ClassLoader getContextClassLoader ( ) throws AndroidException { synchronized ( Android . class ) { final ClassLoader cl = ( contextClassLoader == null ) ? null : contextClassLoader . get ( ) ; if ( cl != null ) { return cl ; } } final Object context = getContext ( ) ; try { final Method method = context ....
Replies the class loader of the current Android context .
6,238
public static void showExceptionDialog ( Exception exception , Component parentComponent , String ... additionalMessages ) { String title = exception . getLocalizedMessage ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "<html><body width='650'>" ) ; sb . append ( "<h2>" ) ; sb . append ( exception . get...
Show exception dialog .
6,239
@ SuppressWarnings ( "unchecked" ) public static < ObsT , SummaryT > Builder < ObsT , SummaryT > forSummarizer ( final ObservationSummarizer < ? super ObsT , ? extends SummaryT > observationSummarizer , int numSamples , final Random rng ) { return new Builder < ObsT , SummaryT > ( ( ObservationSummarizer < ObsT , Summa...
cast is safe - see covariance and contravariance notes on ObservationSummarizer
6,240
@ SuppressWarnings ( "static-method" ) public PrintConfigCommand providePrintConfigCommand ( Provider < BootLogger > bootLogger , Provider < ModulesMetadata > modulesMetadata , Injector injector ) { return new PrintConfigCommand ( bootLogger , modulesMetadata , injector ) ; }
Provide the command for running the command for printing out the configuration values .
6,241
protected final void fireShapeChanged ( ) { resetBoundingBox ( ) ; if ( isEventFirable ( ) ) { final GISElementContainer < ? > container = getContainer ( ) ; if ( container != null ) { container . onMapElementGraphicalAttributeChanged ( ) ; } } }
Invoked when the shape of this element changed .
6,242
protected final boolean boundsIntersects ( Shape2D < ? , ? , ? , ? , ? , ? extends Rectangle2afp < ? , ? , ? , ? , ? , ? > > rectangle ) { final Rectangle2d bounds = getBoundingBox ( ) ; assert bounds != null ; return bounds . intersects ( rectangle ) ; }
Replies if the bounds of this element has an intersection with the specified rectangle .
6,243
public boolean isContainerColorUsed ( ) { final AttributeValue val = getAttributeCollection ( ) . getAttribute ( ATTR_USE_CONTAINER_COLOR ) ; if ( val != null ) { try { return val . getBoolean ( ) ; } catch ( AttributeException e ) { } } return false ; }
Replies the flag that indicates if this element use its color or the container s color .
6,244
public VisualizationType getVisualizationType ( ) { if ( this . vizualizationType == null ) { final AttributeValue val = getAttributeCollection ( ) . getAttribute ( ATTR_VISUALIZATION_TYPE ) ; if ( val != null ) { try { this . vizualizationType = val . getJavaObject ( ) ; } catch ( Exception e ) { } } if ( this . vizua...
Replies the type of visualization that must be used by this element .
6,245
public void setVisualizationType ( VisualizationType type ) { try { if ( getVisualizationType ( ) != type ) { this . vizualizationType = type ; getAttributeCollection ( ) . setAttribute ( ATTR_VISUALIZATION_TYPE , new AttributeValueImpl ( type ) ) ; } } catch ( AttributeException e ) { } }
Set the type of visualization that must be used by this element .
6,246
@ SuppressWarnings ( "static-method" ) public Vector1dfx newVector ( ObjectProperty < WeakReference < Segment1D < ? , ? > > > segment , DoubleProperty x , DoubleProperty y ) { return new Vector1dfx ( segment , x , y ) ; }
Create a vector with properties .
6,247
public static final boolean isBlank ( String s ) { if ( s == null || s . trim ( ) . length ( ) == 0 ) { return true ; } return false ; }
Whether string is a space or null
6,248
public T set ( T newValue ) { final T obj = this . object ; this . object = newValue ; return obj ; }
Set the parameter .
6,249
public static String getPreferredAttributeNameForRoadWidth ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . get ( "ROAD_WIDTH_ATTR_NAME" , DEFAULT_ATTR_ROAD_WIDTH ) ; } return DEFAULT_ATTR_ROAD_WIDTH ; }
Replies the preferred name for the width of the roads .
6,250
public static void setPreferredAttributeNameForRoadWidth ( String name ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( name == null || "" . equals ( name ) || DEFAULT_ATTR_ROAD_WIDTH . equalsIgnoreCase ( name ) ) { prefs . remove ( "ROAD_WIDT...
Set the preferred name for the width of the roads .
6,251
public static String getPreferredAttributeNameForLaneCount ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . get ( "LANE_COUNT_ATTR_NAME" , DEFAULT_ATTR_LANE_COUNT ) ; } return DEFAULT_ATTR_LANE_COUNT ; }
Replies the preferred name for the number of lanes of the roads .
6,252
public static void setPreferredAttributeNameForLaneCount ( String name ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( name == null || "" . equals ( name ) || DEFAULT_ATTR_LANE_COUNT . equalsIgnoreCase ( name ) ) { prefs . remove ( "LANE_COUN...
Set the preferred name for the number of lanes of the roads .
6,253
public static int getPreferredLaneCount ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . getInt ( "LANE_COUNT" , DEFAULT_LANE_COUNT ) ; } return DEFAULT_LANE_COUNT ; }
Replies the preferred number of lanes for a road segment .
6,254
public static void setPreferredLaneCount ( int count ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( count < 0 ) { prefs . remove ( "LANE_COUNT" ) ; } else { prefs . putInt ( "LANE_COUNT" , count ) ; } } }
Set the preferred number of lanes for a road segment .
6,255
public static double getPreferredLaneWidth ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . getDouble ( "LANE_WIDTH" , DEFAULT_LANE_WIDTH ) ; } return DEFAULT_LANE_WIDTH ; }
Replies the preferred width of a lane for a road segment .
6,256
public static void setPreferredLaneWidth ( double width ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( width <= 0 ) { prefs . remove ( "LANE_WIDTH" ) ; } else { prefs . putDouble ( "LANE_WIDTH" , width ) ; } } }
Set the preferred width of a lane for a road segment .
6,257
public static LegalTrafficSide getPreferredLegalTrafficSide ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; String name = null ; if ( prefs != null ) { name = prefs . get ( "LEGAL_TRAFFIC_SIDE" , null ) ; } if ( name != null ) { LegalTrafficSide side ; try { side = Le...
Replies the preferred side of traffic for vehicles on road segments .
6,258
public static void setPreferredLegalTrafficSide ( LegalTrafficSide side ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( side == null ) { prefs . remove ( "LEGAL_TRAFFIC_SIDE" ) ; } else { prefs . put ( "LEGAL_TRAFFIC_SIDE" , side . name ( ) )...
Set the preferred side of traffic for vehicles on road segments .
6,259
public static String getPreferredAttributeNameForTrafficDirection ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . get ( "TRAFFIC_DIRECTION_ATTR_NAME" , DEFAULT_ATTR_TRAFFIC_DIRECTION ) ; } return DEFAULT_ATTR_TRAFFIC_DIRECTION ; }
Replies the preferred name for the traffic direction on the roads .
6,260
public static void setPreferredAttributeNameForTrafficDirection ( String name ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( name == null || "" . equals ( name ) || DEFAULT_ATTR_TRAFFIC_DIRECTION . equalsIgnoreCase ( name ) ) { prefs . remov...
Set the preferred name for the traffic direction on the roads .
6,261
public static String getPreferredAttributeValueForTrafficDirection ( TrafficDirection direction , int index ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { final StringBuilder b = new StringBuilder ( ) ; b . append ( "TRAFFIC_DIRECTION_VALUE_" ) ;...
Replies the preferred value of traffic direction used in the attributes for the traffic direction on the roads .
6,262
public static List < String > getPreferredAttributeValuesForTrafficDirection ( TrafficDirection direction ) { final List < String > array = new ArrayList < > ( ) ; int i = 0 ; String value = getPreferredAttributeValueForTrafficDirection ( direction , i ) ; while ( value != null ) { array . add ( value ) ; value = getPr...
Replies the preferred values of traffic direction used in the attributes for the traffic direction on the roads .
6,263
public static String getSystemDefault ( TrafficDirection direction , int valueIndex ) { switch ( direction ) { case DOUBLE_WAY : switch ( valueIndex ) { case 0 : return DEFAULT_DOUBLE_WAY_TRAFFIC_DIRECTION_0 ; case 1 : return DEFAULT_DOUBLE_WAY_TRAFFIC_DIRECTION_1 ; default : throw new IndexOutOfBoundsException ( ) ; }...
Replies the system default string - value for the traffic direction at the given index in the list of system default values .
6,264
public static String getSystemDefault ( RoadType type ) { switch ( type ) { case OTHER : return DEFAULT_OTHER_ROAD_TYPE ; case PRIVACY_PATH : return DEFAULT_PRIVACY_ROAD_TYPE ; case TRACK : return DEFAULT_TRACK_ROAD_TYPE ; case BIKEWAY : return DEFAULT_BIKEWAY_ROAD_TYPE ; case LOCAL_ROAD : return DEFAULT_LOCAL_ROAD_ROA...
Replies the system - default value for the type of road .
6,265
public static List < String > getSystemDefaults ( TrafficDirection direction ) { final List < String > array = new ArrayList < > ( ) ; try { int i = 0 ; while ( true ) { array . add ( getSystemDefault ( direction , i ) ) ; ++ i ; } } catch ( AssertionError e ) { throw e ; } catch ( Throwable exception ) { } return arra...
Replies the system default string - values for the traffic direction .
6,266
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 ( "TRAF...
Set the preferred value of traffic direction used in the attributes for the traffic direction on the roads .
6,267
public static double getPreferredRoadConnectionDistance ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . getDouble ( "ROAD_CONNECTION_DISTANCE" , DEFAULT_ROAD_CONNECTION_DISTANCE ) ; } return DEFAULT_ROAD_CONNECTION_DISTANCE ; }
Replies the preferred distance below which roads may be connected .
6,268
public static void setPreferredRoadConnectionDistance ( double distance ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( distance <= 0. ) { prefs . remove ( "ROAD_CONNECTION_DISTANCE" ) ; } else { prefs . putDouble ( "ROAD_CONNECTION_DISTANCE"...
Set the preferred distance below which roads may be connected .
6,269
public static RoadType getPreferredRoadType ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; String name = null ; if ( prefs != null ) { name = prefs . get ( "ROAD_TYPE" , null ) ; } if ( name != null ) { RoadType type ; try { type = RoadType . valueOf ( name ) ; } cat...
Replies the preferred type of road segment .
6,270
public static void setPreferredRoadType ( RoadType type ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( type == null ) { prefs . remove ( "ROAD_TYPE" ) ; } else { prefs . put ( "ROAD_TYPE" , type . name ( ) ) ; } } }
Set the preferred type of road segment .
6,271
public static String getPreferredAttributeNameForRoadType ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . get ( "ROAD_TYPE_ATTR_NAME" , DEFAULT_ATTR_ROAD_TYPE ) ; } return DEFAULT_ATTR_ROAD_TYPE ; }
Replies the preferred name for the types of the roads .
6,272
public static void setPreferredAttributeNameForRoadType ( String name ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( name == null || "" . equals ( name ) || DEFAULT_ATTR_ROAD_TYPE . equalsIgnoreCase ( name ) ) { prefs . remove ( "ROAD_TYPE_A...
Set the preferred name for the types of the roads .
6,273
public static String getPreferredAttributeValueForRoadType ( RoadType type ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { final String v = prefs . get ( "ROAD_TYPE_VALUE_" + type . name ( ) , null ) ; if ( v != null && ! "" . equals ( v ) ) { ret...
Replies the preferred value of road type used in the attributes for the types of the roads .
6,274
public static void setPreferredAttributeValueForRoadType ( RoadType type , String value ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { final String sysDef = getSystemDefault ( type ) ; if ( value == null || "" . equals ( value ) || sysDef . equal...
Set the preferred value of road type used in the attributes for the types of the roads .
6,275
public static String getPreferredAttributeNameForRoadName ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . get ( "ROAD_NAME_ATTR_NAME" , DEFAULT_ATTR_ROAD_NAME ) ; } return DEFAULT_ATTR_ROAD_NAME ; }
Replies the preferred name for the name of the roads .
6,276
public static void setPreferredAttributeNameForRoadName ( String name ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( name == null || "" . equals ( name ) || DEFAULT_ATTR_ROAD_NAME . equalsIgnoreCase ( name ) ) { prefs . remove ( "ROAD_NAME_A...
Set the preferred name for the name of the roads .
6,277
public static String getPreferredAttributeNameForRoadNumber ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . get ( "ROAD_NUMBER_ATTR_NAME" , DEFAULT_ATTR_ROAD_NUMBER ) ; } return DEFAULT_ATTR_ROAD_NUMBER ; }
Replies the preferred name for the numbers of the roads .
6,278
public static void setPreferredAttributeNameForRoadNumber ( String name ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( name == null || "" . equals ( name ) || DEFAULT_ATTR_ROAD_NUMBER . equalsIgnoreCase ( name ) ) { prefs . remove ( "ROAD_NU...
Set the preferred name for the numbers of the roads .
6,279
@ SuppressWarnings ( "checkstyle:magicnumber" ) public void readDBFHeader ( ) throws IOException { if ( this . finished ) { throw new EOFDBaseFileException ( ) ; } if ( this . fieldCount != - 1 ) { return ; } this . fileVersion = this . stream . readByte ( ) ; final Calendar cal = new GregorianCalendar ( ) ; cal . set ...
Read the header of the DBF file .
6,280
public String getDBFFieldName ( int index ) { if ( this . fieldCount != - 1 ) { try { final DBaseFileField field = this . fields . get ( index ) ; if ( field != null ) { return field . getName ( ) ; } } catch ( Exception exception ) { } } return null ; }
Replies the name of the i - th field .
6,281
public int getDBFFieldIndex ( String name ) { assert name != null ; if ( this . fieldCount != - 1 ) { try { int i = 0 ; for ( final DBaseFileField field : this . fields ) { if ( field != null && name . equals ( field . getName ( ) ) ) { return i ; } ++ i ; } } catch ( Exception exception ) { } } return - 1 ; }
Replies the column index of the specified column name .
6,282
public DBaseFieldType getDBFFieldType ( int index ) { if ( this . fieldCount != - 1 ) { try { final DBaseFileField field = this . fields . get ( index ) ; if ( field != null ) { return field . getType ( ) ; } } catch ( Exception exception ) { } } return null ; }
Replies the type of the i - th field .
6,283
@ SuppressWarnings ( { "checkstyle:npathcomplexity" , "checkstyle:magicnumber" } ) public List < DBaseFileField > readDBFFields ( ) throws IOException , EOFException { if ( this . fields != null ) { return this . fields ; } if ( this . finished ) { throw new EOFDBaseFileException ( ) ; } if ( this . fieldCount == - 1 )...
Read the field definitions . Multiple calls to this method will return always the same data structure . The column list is red only at the first call to this function . So you could use this method to obtain the list of the dBASE file s columns .
6,284
public void skip ( int skipAmount ) throws IOException { if ( this . recordCount == - 1 ) { throw new MustCallReadHeaderFunctionException ( ) ; } if ( ( this . readingPosition + skipAmount ) >= this . recordCount ) { throw new EOFException ( ) ; } if ( skipAmount > 0 ) { this . readingPosition += skipAmount ; final lon...
Move the reading head by the specified record count amount .
6,285
public List < DBaseFileRecord > readRestOfDBFRecords ( ) throws IOException { if ( this . finished ) { throw new EOFDBaseFileException ( ) ; } if ( this . recordCount == - 1 ) { throw new MustCallReadHeaderFunctionException ( ) ; } final Vector < DBaseFileRecord > records = new Vector < > ( ) ; try { while ( this . rea...
Read all the records .
6,286
private int readStringRecordValue ( DBaseFileField field , int nrecord , int nfield , byte [ ] rawData , int rawOffset , OutputParameter < String > value ) throws IOException { final byte [ ] recordData = new byte [ field . getLength ( ) ] ; System . arraycopy ( rawData , rawOffset , recordData , 0 , recordData . lengt...
Read a STRING record value .
6,287
@ SuppressWarnings ( "checkstyle:magicnumber" ) private static int readDateRecordValue ( DBaseFileField field , int nrecord , int nfield , byte [ ] rawData , int rawOffset , OutputParameter < Date > value ) throws IOException { final GregorianCalendar cal = new GregorianCalendar ( ) ; final int year = ( ( rawData [ raw...
Read a DATE record value .
6,288
private static int readNumberRecordValue ( DBaseFileField field , int nrecord , int nfield , byte [ ] rawData , int rawOffset , OutputParameter < Double > value ) throws IOException { final String buffer = new String ( rawData , rawOffset , field . getLength ( ) ) ; try { final String b = buffer . trim ( ) ; if ( b != ...
Read a NUMBER record value .
6,289
@ SuppressWarnings ( "checkstyle:magicnumber" ) private static int readBooleanRecordValue ( DBaseFileField field , int nrecord , int nfield , byte [ ] rawData , int rawOffset , OutputParameter < Boolean > value ) throws IOException { final int byteCode = rawData [ rawOffset ] & 0xFF ; if ( TRUE_CHARS . indexOf ( byteCo...
Read a BOOLEAN record value .
6,290
private static int read2ByteIntegerRecordValue ( DBaseFileField field , int nrecord , int nfield , byte [ ] rawData , int rawOffset , OutputParameter < Integer > value ) throws IOException { final short rawNumber = EndianNumbers . toLEShort ( rawData [ rawOffset ] , rawData [ rawOffset + 1 ] ) ; try { value . set ( new...
Read a 2 BYTE INTEGER record value .
6,291
@ SuppressWarnings ( "checkstyle:magicnumber" ) private static int read4ByteIntegerRecordValue ( DBaseFileField field , int nrecord , int nfield , byte [ ] rawData , int rawOffset , OutputParameter < Long > value ) throws IOException { final int rawNumber = EndianNumbers . toLEInt ( rawData [ rawOffset ] , rawData [ ra...
Read a 4 BYTE INTEGER record value .
6,292
@ SuppressWarnings ( "checkstyle:magicnumber" ) private static int read8ByteDoubleRecordValue ( DBaseFileField field , int nrecord , int nfield , byte [ ] rawData , int rawOffset , OutputParameter < Double > value ) throws IOException { final double rawNumber = EndianNumbers . toLEDouble ( rawData [ rawOffset ] , rawDa...
Read a 8 BYTE DOUBLE record value .
6,293
public boolean isColumnSelectable ( DBaseFileField column ) { return column != null && ( this . selectedColumns . isEmpty ( ) || this . selectedColumns . contains ( column ) ) ; }
Replies if the specified column could be replied or ignored .
6,294
public static void loadDefaultEncryptionModule ( ) { final Provider [ ] providers = Security . getProviders ( ) ; boolean found = false ; for ( final Provider provider : providers ) { if ( provider instanceof SunJCE ) { found = true ; break ; } } if ( ! found ) { Security . addProvider ( new SunJCE ( ) ) ; } }
Load the default encryption module .
6,295
public static String md5 ( String str ) { if ( str == null ) { return "" ; } final byte [ ] uniqueKey = str . getBytes ( ) ; byte [ ] hash = null ; try { hash = MessageDigest . getInstance ( "MD5" ) . digest ( uniqueKey ) ; } catch ( NoSuchAlgorithmException e ) { throw new Error ( Locale . getString ( "NO_MD5" ) ) ; }...
Replies a MD5 key .
6,296
public BooleanProperty isMultiPartsProperty ( ) { if ( this . isMultipart == null ) { this . isMultipart = new ReadOnlyBooleanWrapper ( this , MathFXAttributeNames . IS_MULTIPARTS , false ) ; this . isMultipart . bind ( Bindings . createBooleanBinding ( ( ) -> { boolean foundOne = false ; for ( final PathElementType ty...
Replies the isMultiParts property .
6,297
private String getWthInsiCodeOr ( Map wthData ) { String insiName = getWthInsiCode ( wthData ) ; if ( insiName . equals ( "" ) ) { return getNextDefName ( ) ; } else { return insiName ; } }
Get the 4 - bit institute code for weather file name if not available from data holder then use default code
6,298
public static String getWthInsiCode ( Map wthData ) { String wst_name = getValueOr ( wthData , "wst_name" , "" ) ; if ( wst_name . matches ( "(\\w{4})|(\\w{8})" ) ) { return wst_name ; } String wst_id = getValueOr ( wthData , "wst_id" , "" ) ; if ( wst_id . matches ( "(\\w{4})|(\\w{8})" ) ) { return wst_id ; } wst_id =...
Get the 4 - bit institute code for weather file nam
6,299
public static String getWthYearDuration ( Map wthData ) { String yearDur = "" ; ArrayList < Map > wthRecords = ( ArrayList ) getObjectOr ( wthData , "dailyWeather" , new ArrayList ( ) ) ; if ( ! wthRecords . isEmpty ( ) ) { String startYear = getValueOr ( ( wthRecords . get ( 0 ) ) , "w_date" , " " ) . substring ( 2...
Get the last 2 - bit year number and 2 - bit of the duration for weather file name