idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
6,200 | 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 . | 176 | 19 |
6,201 | public void rotate ( Quaternion rotation , Point3D pivot ) { if ( pivot != null ) { // Change the center Transform3D m1 = new Transform3D ( ) ; m1 . setTranslation ( - pivot . getX ( ) , - pivot . getY ( ) , - pivot . getZ ( ) ) ; Transform3D m2 = new Transform3D ( ) ; m2 . setRotation ( rotation ) ; Transform3D m3 = n... | Rotate the box around a given pivot point . The default pivot point of the center of the box . | 184 | 21 |
6,202 | 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 . | 424 | 6 |
6,203 | @ Pure 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 ) ) ; //$NON-NLS-1$ } while ( busNetwork . getBusStop (... | Replies a bus stop name that was not exist in the specified bus network . | 110 | 16 |
6,204 | 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 . | 78 | 14 |
6,205 | 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 . | 66 | 7 |
6,206 | @ Pure 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 . | 73 | 13 |
6,207 | @ Pure 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 ( ) ) ; }... | Replies the distance between the given bus stop and this bus stop . | 108 | 14 |
6,208 | void addBusHub ( BusHub hub ) { if ( this . hubs == null ) { this . hubs = new WeakArrayList <> ( ) ; } this . hubs . add ( hub ) ; } | Add a hub reference . | 43 | 5 |
6,209 | void removeBusHub ( BusHub hub ) { if ( this . hubs != null ) { this . hubs . remove ( hub ) ; if ( this . hubs . isEmpty ( ) ) { this . hubs = null ; } } } | Remove a hub reference . | 49 | 5 |
6,210 | void addBusHalt ( BusItineraryHalt halt ) { if ( this . halts == null ) { this . halts = new WeakArrayList <> ( ) ; } this . halts . add ( halt ) ; } | Add a bus halt reference . | 51 | 6 |
6,211 | void removeBusHalt ( BusItineraryHalt halt ) { if ( this . halts != null ) { this . halts . remove ( halt ) ; if ( this . halts . isEmpty ( ) ) { this . halts = null ; } } } | Remove a bus halt reference . | 58 | 6 |
6,212 | @ Pure 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 . | 56 | 14 |
6,213 | 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 . | 62 | 13 |
6,214 | @ Pure 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 == ... | Compare the two specified attributes . | 126 | 6 |
6,215 | @ Pure 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 . | 79 | 7 |
6,216 | @ Pure 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 . | 50 | 25 |
6,217 | @ Pure protected final Graph < ST , PT > getParentGraph ( ) { return this . parentGraph == null ? null : this . parentGraph . get ( ) ; } | Replies the parent graph is this subgraph was built . | 36 | 12 |
6,218 | 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 . pare... | Build a subgraph from the specified graph . | 431 | 9 |
6,219 | @ Pure public List < Object > getAddedValues ( ) { if ( this . newValues == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableList ( this . newValues ) ; } | Replies the list of added data . | 47 | 8 |
6,220 | @ Pure public List < Object > getRemovedValues ( ) { if ( this . oldValues == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableList ( this . oldValues ) ; } | Replies the list of removed data . | 47 | 8 |
6,221 | @ Pure public List < Object > getCurrentValues ( ) { if ( this . allValues == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableList ( this . allValues ) ; } | Replies the list of current data . | 47 | 8 |
6,222 | 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 . | 122 | 47 |
6,223 | 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 . | 112 | 14 |
6,224 | 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 . | 80 | 27 |
6,225 | 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 . | 46 | 13 |
6,226 | 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 . | 131 | 6 |
6,227 | @ Pure public static String makeAndroidApplicationName ( String applicationName ) { final String fullName ; if ( applicationName . indexOf ( ' ' ) >= 0 ) { fullName = applicationName ; } else { fullName = "org.arakhne.partnership." + applicationName ; //$NON-NLS-1$ } 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 . | 78 | 29 |
6,228 | @ Pure 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 = co... | Replies the class loader of the current Android context . | 165 | 11 |
6,229 | 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 . | 191 | 4 |
6,230 | @ 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 | 106 | 19 |
6,231 | @ SuppressWarnings ( "static-method" ) @ Provides @ Singleton 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 . | 74 | 15 |
6,232 | protected final void fireShapeChanged ( ) { resetBoundingBox ( ) ; if ( isEventFirable ( ) ) { final GISElementContainer < ? > container = getContainer ( ) ; if ( container != null ) { container . onMapElementGraphicalAttributeChanged ( ) ; } } } | Invoked when the shape of this element changed . | 63 | 10 |
6,233 | @ Pure 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 . | 77 | 16 |
6,234 | @ Pure 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 . | 72 | 18 |
6,235 | @ Pure 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 ( th... | Replies the type of visualization that must be used by this element . | 125 | 14 |
6,236 | 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 . | 78 | 13 |
6,237 | @ 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 . | 62 | 6 |
6,238 | 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 | 39 | 7 |
6,239 | public T set ( T newValue ) { final T obj = this . object ; this . object = newValue ; return obj ; } | Set the parameter . | 28 | 4 |
6,240 | @ Pure 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 ) ; //$NON-NLS-1$ } return DEFAULT_ATTR_ROAD_WIDTH ; } | Replies the preferred name for the width of the roads . | 104 | 12 |
6,241 | 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 ) ) { //$NON-NLS-1$ prefs . remov... | Set the preferred name for the width of the roads . | 157 | 11 |
6,242 | @ Pure 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 ) ; //$NON-NLS-1$ } return DEFAULT_ATTR_LANE_COUNT ; } | Replies the preferred name for the number of lanes of the roads . | 102 | 14 |
6,243 | 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 ) ) { //$NON-NLS-1$ prefs . remov... | Set the preferred name for the number of lanes of the roads . | 155 | 13 |
6,244 | @ Pure public static int getPreferredLaneCount ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . getInt ( "LANE_COUNT" , DEFAULT_LANE_COUNT ) ; //$NON-NLS-1$ } return DEFAULT_LANE_COUNT ; } | Replies the preferred number of lanes for a road segment . | 89 | 12 |
6,245 | public static void setPreferredLaneCount ( int count ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( count < 0 ) { prefs . remove ( "LANE_COUNT" ) ; //$NON-NLS-1$ } else { prefs . putInt ( "LANE_COUNT" , count ) ; //$NON-NLS-1$ } } } | Set the preferred number of lanes for a road segment . | 106 | 11 |
6,246 | @ Pure public static double getPreferredLaneWidth ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . getDouble ( "LANE_WIDTH" , DEFAULT_LANE_WIDTH ) ; //$NON-NLS-1$ } return DEFAULT_LANE_WIDTH ; } | Replies the preferred width of a lane for a road segment . | 92 | 13 |
6,247 | public static void setPreferredLaneWidth ( double width ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( width <= 0 ) { prefs . remove ( "LANE_WIDTH" ) ; //$NON-NLS-1$ } else { prefs . putDouble ( "LANE_WIDTH" , width ) ; //$NON-NLS-1$ } } } | Set the preferred width of a lane for a road segment . | 108 | 12 |
6,248 | @ Pure public static LegalTrafficSide getPreferredLegalTrafficSide ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; String name = null ; if ( prefs != null ) { name = prefs . get ( "LEGAL_TRAFFIC_SIDE" , null ) ; //$NON-NLS-1$ } if ( name != null ) { LegalTrafficSide s... | Replies the preferred side of traffic for vehicles on road segments . | 151 | 13 |
6,249 | public static void setPreferredLegalTrafficSide ( LegalTrafficSide side ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( side == null ) { prefs . remove ( "LEGAL_TRAFFIC_SIDE" ) ; //$NON-NLS-1$ } else { prefs . put ( "LEGAL_TRAFFIC_SIDE" , sid... | Set the preferred side of traffic for vehicles on road segments . | 125 | 12 |
6,250 | @ Pure 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 ) ; //$NON-NLS-1$ } return DEFAULT_ATTR_... | Replies the preferred name for the traffic direction on the roads . | 112 | 13 |
6,251 | 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 ) ) { //$NON-NLS-1$... | Set the preferred name for the traffic direction on the roads . | 165 | 12 |
6,252 | @ Pure 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_VALU... | Replies the preferred value of traffic direction used in the attributes for the traffic direction on the roads . | 216 | 20 |
6,253 | @ Pure 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 =... | Replies the preferred values of traffic direction used in the attributes for the traffic direction on the roads . | 102 | 20 |
6,254 | @ Pure public static String getSystemDefault ( TrafficDirection direction , int valueIndex ) { // Values from the IGN-BDCarto standard 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 ; defaul... | Replies the system default string - value for the traffic direction at the given index in the list of system default values . | 333 | 24 |
6,255 | @ Pure 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_R... | Replies the system - default value for the type of road . | 238 | 13 |
6,256 | @ Pure 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 ) { // } re... | Replies the system default string - values for the traffic direction . | 91 | 13 |
6,257 | 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 . | 248 | 19 |
6,258 | @ Pure public static double getPreferredRoadConnectionDistance ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . getDouble ( "ROAD_CONNECTION_DISTANCE" , DEFAULT_ROAD_CONNECTION_DISTANCE ) ; //$NON-NLS-1$ } return DEFAULT_ROAD_CONNE... | Replies the preferred distance below which roads may be connected . | 104 | 12 |
6,259 | public static void setPreferredRoadConnectionDistance ( double distance ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( distance <= 0. ) { prefs . remove ( "ROAD_CONNECTION_DISTANCE" ) ; //$NON-NLS-1$ } else { prefs . putDouble ( "ROAD_CONNEC... | Set the preferred distance below which roads may be connected . | 117 | 11 |
6,260 | @ Pure public static RoadType getPreferredRoadType ( ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; String name = null ; if ( prefs != null ) { name = prefs . get ( "ROAD_TYPE" , null ) ; //$NON-NLS-1$ } if ( name != null ) { RoadType type ; try { type = RoadType . val... | Replies the preferred type of road segment . | 131 | 9 |
6,261 | public static void setPreferredRoadType ( RoadType type ) { final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { if ( type == null ) { prefs . remove ( "ROAD_TYPE" ) ; //$NON-NLS-1$ } else { prefs . put ( "ROAD_TYPE" , type . name ( ) ) ; //$NON-NLS-1$ } }... | Set the preferred type of road segment . | 107 | 8 |
6,262 | @ Pure 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 ) ; //$NON-NLS-1$ } return DEFAULT_ATTR_ROAD_TYPE ; } | Replies the preferred name for the types of the roads . | 98 | 12 |
6,263 | 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 ) ) { //$NON-NLS-1$ prefs . remove ... | Set the preferred name for the types of the roads . | 151 | 11 |
6,264 | @ Pure 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 ) ; //$NON-NLS-1$ if ( v != null && ! "" .... | Replies the preferred value of road type used in the attributes for the types of the roads . | 124 | 19 |
6,265 | 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 . | 167 | 18 |
6,266 | @ Pure 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 ) ; //$NON-NLS-1$ } return DEFAULT_ATTR_ROAD_NAME ; } | Replies the preferred name for the name of the roads . | 98 | 12 |
6,267 | 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 ) ) { //$NON-NLS-1$ prefs . remove ... | Set the preferred name for the name of the roads . | 151 | 11 |
6,268 | @ Pure 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 ) ; //$NON-NLS-1$ } return DEFAULT_ATTR_ROAD_NUMBER ; } | Replies the preferred name for the numbers of the roads . | 101 | 12 |
6,269 | 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 ) ) { //$NON-NLS-1$ prefs . rem... | Set the preferred name for the numbers of the roads . | 154 | 11 |
6,270 | @ SuppressWarnings ( "checkstyle:magicnumber" ) public void readDBFHeader ( ) throws IOException { if ( this . finished ) { throw new EOFDBaseFileException ( ) ; } if ( this . fieldCount != - 1 ) { // The header was already red return ; } //----------------------------------------------------------- // Bytes Size Conte... | Read the header of the DBF file . | 736 | 9 |
6,271 | @ Pure 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 . | 73 | 11 |
6,272 | @ Pure 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 . | 93 | 11 |
6,273 | @ Pure 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 . | 76 | 11 |
6,274 | @ 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 . | 823 | 50 |
6,275 | 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 ; //this.st... | Move the reading head by the specified record count amount . | 155 | 11 |
6,276 | 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 . read... | Read all the records . | 155 | 5 |
6,277 | 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 . | 190 | 7 |
6,278 | @ 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 . | 383 | 7 |
6,279 | 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 . | 140 | 7 |
6,280 | @ 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 . | 158 | 9 |
6,281 | 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 . | 128 | 11 |
6,282 | @ 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 . | 160 | 11 |
6,283 | @ 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 . | 196 | 11 |
6,284 | @ Pure 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 . | 46 | 12 |
6,285 | public static void loadDefaultEncryptionModule ( ) { // Be sure that the cryptographical algorithms are loaded final Provider [ ] providers = Security . getProviders ( ) ; boolean found = false ; for ( final Provider provider : providers ) { if ( provider instanceof SunJCE ) { found = true ; break ; } } if ( ! found ) ... | Load the default encryption module . | 88 | 6 |
6,286 | public static String md5 ( String str ) { if ( str == null ) { return "" ; //$NON-NLS-1$ } final byte [ ] uniqueKey = str . getBytes ( ) ; byte [ ] hash = null ; try { hash = MessageDigest . getInstance ( "MD5" ) . digest ( uniqueKey ) ; //$NON-NLS-1$ } catch ( NoSuchAlgorithmException e ) { throw new Error ( Locale . ... | Replies a MD5 key . | 247 | 7 |
6,287 | 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 . | 152 | 8 |
6,288 | 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 | 63 | 21 |
6,289 | 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 | 192 | 12 |
6,290 | public static String getWthYearDuration ( Map wthData ) { String yearDur = "" ; ArrayList < Map > wthRecords = ( ArrayList ) getObjectOr ( wthData , "dailyWeather" , new ArrayList ( ) ) ; if ( ! wthRecords . isEmpty ( ) ) { // Get the year of starting date and end date String startYear = getValueOr ( ( wthRecords . get... | Get the last 2 - bit year number and 2 - bit of the duration for weather file name | 386 | 19 |
6,291 | private static IndexEnvironment setupIndexer ( File outputDirectory , int memory , boolean storeDocs ) throws Exception { final IndexEnvironment env = new IndexEnvironment ( ) ; env . setMemory ( memory * ONE_MEGABYTE ) ; final Specification spec = env . getFileClassSpec ( "trectext" ) ; env . addFileClass ( spec ) ; e... | because its only reference is in native code then we will get a crash . | 168 | 15 |
6,292 | @ SuppressWarnings ( "unchecked" ) void registerConsumer ( Inspector < ? super OutT > subInspector ) { consumers . add ( ( Inspector < OutT > ) subInspector ) ; } | Inspector is contravariant in its type | 47 | 11 |
6,293 | @ Pure public static int classifies ( AbstractGISTreeSetNode < ? , ? > node , GeoLocation location ) { if ( node . getZone ( ) == IcosepQuadTreeZone . ICOSEP ) { return classifiesIcocep ( node . verticalSplit , node . horizontalSplit , location . toBounds2D ( ) ) ; } return classifiesNonIcocep ( node . verticalSplit , ... | Replies the classificiation of the specified location . | 109 | 11 |
6,294 | @ Pure static boolean contains ( int region , double cutX , double cutY , double pointX , double pointY ) { switch ( IcosepQuadTreeZone . values ( ) [ region ] ) { case SOUTH_WEST : return pointX <= cutX && pointY <= cutY ; case SOUTH_EAST : return pointX >= cutX && pointY <= cutY ; case NORTH_WEST : return pointX <= c... | Replies if the given region contains the given point . | 139 | 11 |
6,295 | @ Pure private static boolean isOutsideNodeBuildingBounds ( AbstractGISTreeSetNode < ? , ? > node , Rectangle2afp < ? , ? , ? , ? , ? , ? > location ) { final Rectangle2d b2 = getNormalizedNodeBuildingBounds ( node , location ) ; if ( b2 == null ) { return false ; } return Rectangle2afp . classifiesRectangleRectangle (... | Replies if the given geolocation is outside the building bounds of the given node . | 170 | 18 |
6,296 | private static Rectangle2d union ( AbstractGISTreeSetNode < ? , ? > node , Rectangle2afp < ? , ? , ? , ? , ? , ? > shape ) { final Rectangle2d b = getNodeBuildingBounds ( node ) ; b . setUnion ( shape ) ; normalize ( b , shape ) ; return b ; } | Compute the union of the building bounds of the given node and the given geolocation . | 78 | 19 |
6,297 | @ Pure public static Rectangle2d getNodeBuildingBounds ( AbstractGISTreeSetNode < ? , ? > node ) { assert node != null ; final double w = node . nodeWidth / 2. ; final double h = node . nodeHeight / 2. ; final IcosepQuadTreeZone zone = node . getZone ( ) ; final double lx ; final double ly ; if ( zone == null ) { // Is... | Replies the bounds of the area covered by the node . The replied rectangle is not normalized . | 282 | 19 |
6,298 | private static < P extends GISPrimitive , N extends AbstractGISTreeSetNode < P , N > > N createNode ( N parent , IcosepQuadTreeZone region , GISTreeSetNodeFactory < P , N > builder ) { Rectangle2d area = parent . getAreaBounds ( ) ; if ( region == IcosepQuadTreeZone . ICOSEP ) { return builder . newNode ( IcosepQuadTre... | Create a child node that supports the specified region . | 311 | 10 |
6,299 | private static Rectangle2d computeIcosepSubarea ( IcosepQuadTreeZone region , Rectangle2d area ) { if ( area == null || area . isEmpty ( ) ) { return area ; } final double demiWidth = area . getWidth ( ) / 2. ; final double demiHeight = area . getHeight ( ) / 2. ; switch ( region ) { case ICOSEP : return area ; case SO... | Computes the area covered by a child node of an icosep - node . | 261 | 17 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.