idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
6,300
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 ) ; env . setStoreDocs ( storeDocs ) ; env . setMetadataIndexedFields ( new String [ ] { "docno" } , new String [ ] { "docno" } ) ; env . create ( outputDirectory . getAbsolutePath ( ) , statusMonitor ) ; return env ; }
because its only reference is in native code then we will get a crash .
6,301
@ SuppressWarnings ( "unchecked" ) void registerConsumer ( Inspector < ? super OutT > subInspector ) { consumers . add ( ( Inspector < OutT > ) subInspector ) ; }
Inspector is contravariant in its type
6,302
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 , node . horizontalSplit , location . toBounds2D ( ) ) ; }
Replies the classificiation of the specified location .
6,303
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 <= cutX && pointY >= cutY ; case NORTH_EAST : return pointX >= cutX && pointY >= cutY ; case ICOSEP : return true ; default : } return false ; }
Replies if the given region contains the given point .
6,304
private static boolean isOutsideNodeBuildingBounds ( AbstractGISTreeSetNode < ? , ? > node , Rectangle2afp < ? , ? , ? , ? , ? , ? > location ) { final Rectangle2d b2 = getNormalizedNodeBuildingBounds ( node , location ) ; if ( b2 == null ) { return false ; } return Rectangle2afp . classifiesRectangleRectangle ( b2 . getMinX ( ) , b2 . getMinY ( ) , b2 . getMaxX ( ) , b2 . getMaxY ( ) , location . getMinX ( ) , location . getMinY ( ) , location . getMaxX ( ) , location . getMaxY ( ) ) != IntersectionType . INSIDE ; }
Replies if the given geolocation is outside the building bounds of the given node .
6,305
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 .
6,306
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 ) { lx = node . verticalSplit - w ; ly = node . horizontalSplit - h ; } else { switch ( zone ) { case SOUTH_EAST : lx = node . verticalSplit ; ly = node . horizontalSplit - h ; break ; case SOUTH_WEST : lx = node . verticalSplit - w ; ly = node . horizontalSplit - h ; break ; case NORTH_EAST : lx = node . verticalSplit ; ly = node . horizontalSplit ; break ; case NORTH_WEST : lx = node . verticalSplit - w ; ly = node . horizontalSplit ; break ; case ICOSEP : return getNodeBuildingBounds ( node . getParentNode ( ) ) ; default : throw new IllegalStateException ( ) ; } } return new Rectangle2d ( lx , ly , node . nodeWidth , node . nodeHeight ) ; }
Replies the bounds of the area covered by the node . The replied rectangle is not normalized .
6,307
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 ( IcosepQuadTreeZone . ICOSEP , area . getMinX ( ) , area . getMinY ( ) , area . getWidth ( ) , area . getHeight ( ) ) ; } if ( parent . getZone ( ) == IcosepQuadTreeZone . ICOSEP ) { area = computeIcosepSubarea ( region , area ) ; return builder . newNode ( region , area . getMinX ( ) , area . getMinY ( ) , area . getWidth ( ) , area . getHeight ( ) ) ; } final Point2d childCutPlane = computeCutPoint ( region , parent ) ; assert childCutPlane != null ; final double w = area . getWidth ( ) / 4. ; final double h = area . getHeight ( ) / 4. ; return builder . newNode ( region , childCutPlane . getX ( ) - w , childCutPlane . getY ( ) - h , 2. * w , 2. * h ) ; }
Create a child node that supports the specified region .
6,308
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 SOUTH_WEST : return new Rectangle2d ( area . getMinX ( ) , area . getMinY ( ) , demiWidth , demiHeight ) ; case NORTH_WEST : return new Rectangle2d ( area . getMinX ( ) , area . getCenterY ( ) , demiWidth , demiHeight ) ; case NORTH_EAST : return new Rectangle2d ( area . getCenterX ( ) , area . getMinY ( ) , demiWidth , demiHeight ) ; case SOUTH_EAST : return new Rectangle2d ( area . getMinX ( ) , area . getMinY ( ) , demiWidth , demiHeight ) ; default : } throw new IllegalStateException ( ) ; }
Computes the area covered by a child node of an icosep - node .
6,309
private static < P extends GISPrimitive , N extends AbstractGISTreeSetNode < P , N > > Point2d computeCutPoint ( IcosepQuadTreeZone region , N parent ) { final double w = parent . nodeWidth / 4. ; final double h = parent . nodeHeight / 4. ; final double x ; final double y ; switch ( region ) { case SOUTH_WEST : x = parent . verticalSplit - w ; y = parent . horizontalSplit - h ; break ; case SOUTH_EAST : x = parent . verticalSplit + w ; y = parent . horizontalSplit - h ; break ; case NORTH_WEST : x = parent . verticalSplit - w ; y = parent . horizontalSplit + h ; break ; case NORTH_EAST : x = parent . verticalSplit + w ; y = parent . horizontalSplit + h ; break ; case ICOSEP : default : return null ; } return new Point2d ( x , y ) ; }
Computes the cut planes position of the given region .
6,310
private static < P extends GISPrimitive , N extends AbstractGISTreeSetNode < P , N > > N rearrangeTree ( AbstractGISTreeSet < P , N > tree , N node , Rectangle2afp < ? , ? , ? , ? , ? , ? > desiredBounds , GISTreeSetNodeFactory < P , N > builder ) { N topNode = node . getParentNode ( ) ; while ( topNode != null && isOutsideNodeBuildingBounds ( topNode , desiredBounds ) ) { topNode = topNode . getParentNode ( ) ; } final Rectangle2afp < ? , ? , ? , ? , ? , ? > dr ; if ( topNode == null ) { topNode = tree . getTree ( ) . getRoot ( ) ; if ( topNode == null ) { throw new IllegalStateException ( ) ; } dr = union ( topNode , desiredBounds ) ; } else { dr = getNormalizedNodeBuildingBounds ( topNode , desiredBounds ) ; } final N parent = topNode . getParentNode ( ) ; final Iterator < P > dataIterator = new PrefixDataDepthFirstTreeIterator < > ( topNode ) ; final N newTopNode = builder . newNode ( topNode . getZone ( ) , dr . getMinX ( ) , dr . getMinY ( ) , dr . getWidth ( ) , dr . getHeight ( ) ) ; while ( dataIterator . hasNext ( ) ) { if ( ! addInside ( tree , newTopNode , dataIterator . next ( ) , builder , false ) ) { throw new IllegalStateException ( ) ; } } if ( parent != null ) { parent . setChildAt ( topNode . getZone ( ) . ordinal ( ) , newTopNode ) ; return parent ; } tree . getTree ( ) . setRoot ( newTopNode ) ; return newTopNode ; }
Try to rearrange the cut planes of the given node .
6,311
protected synchronized void addShapeGeometryChangeListener ( ShapeGeometryChangeListener listener ) { assert listener != null : AssertMessages . notNullParameter ( ) ; if ( this . geometryListeners == null ) { this . geometryListeners = new WeakArrayList < > ( ) ; } this . geometryListeners . add ( listener ) ; }
Add listener on geometry changes .
6,312
protected synchronized void removeShapeGeometryChangeListener ( ShapeGeometryChangeListener listener ) { assert listener != null : AssertMessages . notNullParameter ( ) ; if ( this . geometryListeners != null ) { this . geometryListeners . remove ( listener ) ; if ( this . geometryListeners . isEmpty ( ) ) { this . geometryListeners = null ; } } }
Remove listener on geometry changes .
6,313
protected synchronized void fireGeometryChange ( ) { if ( this . geometryListeners == null ) { return ; } final ShapeGeometryChangeListener [ ] array = new ShapeGeometryChangeListener [ this . geometryListeners . size ( ) ] ; this . geometryListeners . toArray ( array ) ; for ( final ShapeGeometryChangeListener listener : array ) { listener . shapeGeometryChange ( this ) ; } }
Notify any listener of a geometry change .
6,314
protected void setupListeners ( ) { addDrawingListener ( new DrawingListener ( ) { private long time ; public void onDrawingStart ( ) { this . time = System . currentTimeMillis ( ) ; getCorner ( ) . setColor ( Color . ORANGERED ) ; } public void onDrawingEnd ( ) { getCorner ( ) . setColor ( null ) ; final long duration = System . currentTimeMillis ( ) - this . time ; getLogger ( ) . fine ( "Rendering duration: " + Duration . millis ( duration ) . toString ( ) ) ; } } ) ; }
Setup the response based on listeners .
6,315
@ SuppressWarnings ( { "checkstyle:cyclomaticcomplexity" , "checkstyle:npathcomplexity" , "checkstyle:nestedifdepth" } ) protected void setupMousing ( ) { final ZoomableCanvas < T > canvas = getDocumentCanvas ( ) ; canvas . addEventHandler ( MouseEvent . MOUSE_PRESSED , e -> { this . pressX = e . getX ( ) ; this . pressY = e . getY ( ) ; this . hbarValue = this . hbar . getValue ( ) ; this . vbarValue = this . vbar . getValue ( ) ; } ) ; setOnDragDetected ( getDefaultOnDragDetectedEventHandler ( ) ) ; addEventFilter ( MouseEvent . MOUSE_RELEASED , e -> { if ( this . dragDetected ) { this . dragDetected = false ; final Cursor scurs = this . savedCursor ; this . savedCursor = null ; if ( scurs != null ) { getDocumentCanvas ( ) . setCursor ( scurs ) ; requestLayout ( ) ; } } } ) ; addEventHandler ( DragEvent . DRAG_DONE , event -> { if ( this . dragDetected ) { this . dragDetected = false ; final Cursor scurs = this . savedCursor ; this . savedCursor = null ; if ( scurs != null ) { getDocumentCanvas ( ) . setCursor ( scurs ) ; requestLayout ( ) ; } } } ) ; addEventHandler ( MouseEvent . MOUSE_DRAGGED , getDefaultOnMouseDraggedEventHandler ( ) ) ; addEventHandler ( ScrollEvent . SCROLL_STARTED , event -> { this . scrollDetected = true ; } ) ; addEventHandler ( ScrollEvent . SCROLL_FINISHED , event -> { this . scrollDetected = false ; } ) ; addEventHandler ( ScrollEvent . SCROLL , event -> { if ( ! this . scrollDetected ) { event . consume ( ) ; final double delta ; if ( event . getDeltaY ( ) != 0. ) { delta = event . getDeltaY ( ) ; } else { delta = event . getDeltaX ( ) ; } if ( delta < 0 ) { zoomOut ( ) ; } else { zoomIn ( ) ; } } } ) ; }
Setup the response of the pane to mouse events .
6,316
protected void setupKeying ( ) { setOnKeyPressed ( event -> { switch ( event . getCode ( ) ) { case LEFT : moveLeft ( event . isShiftDown ( ) , event . isControlDown ( ) , false ) ; event . consume ( ) ; break ; case RIGHT : moveRight ( event . isShiftDown ( ) , event . isControlDown ( ) , false ) ; event . consume ( ) ; break ; case UP : if ( event . isAltDown ( ) ) { zoomIn ( ) ; } else { moveUp ( event . isShiftDown ( ) , event . isControlDown ( ) , false ) ; } event . consume ( ) ; break ; case DOWN : if ( event . isAltDown ( ) ) { zoomOut ( ) ; } else { moveDown ( event . isShiftDown ( ) , event . isControlDown ( ) , false ) ; } event . consume ( ) ; break ; case PAGE_UP : if ( event . isControlDown ( ) ) { moveLeft ( false , false , true ) ; } else { moveUp ( false , false , true ) ; } event . consume ( ) ; break ; case PAGE_DOWN : if ( event . isControlDown ( ) ) { moveRight ( false , false , true ) ; } else { moveDown ( false , false , true ) ; } event . consume ( ) ; break ; default : } } ) ; }
Setup the response of the pane to key events .
6,317
public void moveLeft ( boolean isUnit , boolean isLarge , boolean isVeryLarge ) { double inc = isUnit ? this . hbar . getUnitIncrement ( ) : ( isLarge ? LARGE_MOVE_FACTOR : ( isVeryLarge ? VERY_LARGE_MOVE_FACTOR : STANDARD_MOVE_FACTOR ) ) * this . hbar . getBlockIncrement ( ) ; if ( ! isInvertedAxisX ( ) ) { inc = - inc ; } this . hbar . setValue ( Utils . clamp ( this . hbar . getMin ( ) , this . hbar . getValue ( ) + inc , this . hbar . getMax ( ) ) ) ; }
Move the viewport left .
6,318
public void moveUp ( boolean isUnit , boolean isLarge , boolean isVeryLarge ) { double inc = isUnit ? this . vbar . getUnitIncrement ( ) : ( isLarge ? LARGE_MOVE_FACTOR : ( isVeryLarge ? VERY_LARGE_MOVE_FACTOR : STANDARD_MOVE_FACTOR ) ) * this . vbar . getBlockIncrement ( ) ; if ( ! isInvertedAxisY ( ) ) { inc = - inc ; } this . vbar . setValue ( Utils . clamp ( this . vbar . getMin ( ) , this . vbar . getValue ( ) + inc , this . vbar . getMax ( ) ) ) ; }
Move the viewport up .
6,319
public ObjectProperty < Logger > loggerProperty ( ) { if ( this . logger == null ) { this . logger = new SimpleObjectProperty < Logger > ( this , LOGGER_PROPERTY , Logger . getLogger ( getClass ( ) . getName ( ) ) ) { protected void invalidated ( ) { final Logger log = get ( ) ; if ( log == null ) { set ( Logger . getLogger ( getClass ( ) . getName ( ) ) ) ; } } } ; } return this . logger ; }
Replies the property that contains the logger .
6,320
public ObjectProperty < MouseButton > panButtonProperty ( ) { if ( this . panButton == null ) { this . panButton = new StyleableObjectProperty < MouseButton > ( DEFAULT_PAN_BUTTON ) { @ SuppressWarnings ( "synthetic-access" ) protected void invalidated ( ) { final MouseButton button = get ( ) ; if ( button == null ) { set ( DEFAULT_PAN_BUTTON ) ; } } public CssMetaData < ZoomablePane < ? > , MouseButton > getCssMetaData ( ) { return StyleableProperties . PAN_BUTTON ; } public Object getBean ( ) { return ZoomablePane . this ; } public String getName ( ) { return PAN_BUTTON_PROPERTY ; } } ; } return this . panButton ; }
Replies the property for the button that serves for starting the mouse scrolling .
6,321
public DoubleProperty panSensitivityProperty ( ) { if ( this . panSensitivity == null ) { this . panSensitivity = new StyleableDoubleProperty ( DEFAULT_PAN_SENSITIVITY ) { public void invalidated ( ) { if ( get ( ) <= MIN_PAN_SENSITIVITY ) { set ( MIN_PAN_SENSITIVITY ) ; } } public CssMetaData < ZoomablePane < ? > , Number > getCssMetaData ( ) { return StyleableProperties . PAN_SENSITIVITY ; } public Object getBean ( ) { return ZoomablePane . this ; } public String getName ( ) { return PAN_SENSITIVITY_PROPERTY ; } } ; } return this . panSensitivity ; }
Replies the property that indicates the sensibility of the panning moves . The sensibility is a strictly positive number that is multiplied to the distance covered by the mouse motion for obtaining the move to apply to the document . The default value is 1 .
6,322
public double getPanSensitivity ( boolean unitSensitivityModifier , boolean hugeSensivityModifier ) { if ( unitSensitivityModifier ) { return DEFAULT_PAN_SENSITIVITY ; } final double sens = getPanSensitivity ( ) ; if ( hugeSensivityModifier ) { return sens * LARGE_MOVE_FACTOR ; } return sens ; }
Replies the sensibility of the panning moves after applying dynamic user interaction modifiers . The sensibility is a strictly positive number that is multiplied to the distance covered by the mouse motion for obtaining the move to apply to the document . The default value is 1 .
6,323
public static void setGlobalSplineApproximationRatio ( Double distance ) { if ( distance == null || Double . isNaN ( distance . doubleValue ( ) ) ) { globalSplineApproximation = GeomConstants . SPLINE_APPROXIMATION_RATIO ; } else { globalSplineApproximation = Math . max ( 0 , distance ) ; } }
Change the maximum distance that the line segments used to approximate the curved segments are allowed to deviate from any point on the original curve .
6,324
public ESRIBounds createUnion ( ESRIBounds bounds ) { final ESRIBounds eb = new ESRIBounds ( ) ; eb . minx = ( bounds . minx < this . minx ) ? bounds . minx : this . minx ; eb . maxx = ( bounds . maxx < this . maxx ) ? this . maxx : bounds . maxx ; eb . miny = ( bounds . miny < this . miny ) ? bounds . miny : this . miny ; eb . maxy = ( bounds . maxy < this . maxy ) ? this . maxy : bounds . maxy ; eb . minz = ( bounds . minz < this . minz ) ? bounds . minz : this . minz ; eb . maxz = ( bounds . maxz < this . maxz ) ? this . maxz : bounds . maxz ; eb . minm = ( bounds . minm < this . minm ) ? bounds . minm : this . minm ; eb . maxm = ( bounds . maxm < this . maxm ) ? this . maxm : bounds . maxm ; return eb ; }
Create and replies an union of this bounds and the given bounds .
6,325
public void add ( ESRIPoint point ) { if ( point . getX ( ) < this . minx ) { this . minx = point . getX ( ) ; } if ( point . getX ( ) > this . maxx ) { this . maxx = point . getX ( ) ; } if ( point . getY ( ) < this . miny ) { this . miny = point . getY ( ) ; } if ( point . getY ( ) > this . maxy ) { this . maxy = point . getY ( ) ; } if ( point . getZ ( ) < this . minz ) { this . minz = point . getZ ( ) ; } if ( point . getZ ( ) > this . maxz ) { this . maxz = point . getZ ( ) ; } if ( point . getM ( ) < this . minm ) { this . minm = point . getM ( ) ; } if ( point . getM ( ) > this . maxm ) { this . maxm = point . getM ( ) ; } }
Add a point to this bounds .
6,326
public Rectangle2d toRectangle2d ( ) { final Rectangle2d bounds = new Rectangle2d ( ) ; bounds . setFromCorners ( this . minx , this . miny , this . maxx , this . maxy ) ; return bounds ; }
Replies the 2D bounds .
6,327
public void ensureMinMax ( ) { double t ; if ( this . maxx < this . minx ) { t = this . minx ; this . minx = this . maxx ; this . maxx = t ; } if ( this . maxy < this . miny ) { t = this . miny ; this . miny = this . maxy ; this . maxy = t ; } if ( this . maxz < this . minz ) { t = this . minz ; this . minz = this . maxz ; this . maxz = t ; } if ( this . maxm < this . minm ) { t = this . minm ; this . minm = this . maxm ; this . maxm = t ; } }
Ensure that min and max values are correctly ordered .
6,328
public ESRIBounds getBoundsFromHeader ( ) { try { readHeader ( ) ; } catch ( IOException exception ) { return null ; } return new ESRIBounds ( this . minx , this . maxx , this . miny , this . maxy , this . minz , this . maxz , this . minm , this . maxm ) ; }
Replies the bounds read from the shape file header .
6,329
public E read ( ) throws IOException { boolean status = false ; try { readHeader ( ) ; E element ; try { do { element = readRecord ( this . nextExpectedRecordIndex ) ; if ( ! postRecordReadingStage ( element ) ) { element = null ; } ++ this . nextExpectedRecordIndex ; } while ( element == null ) ; } catch ( EOFException e ) { element = null ; close ( ) ; postReadingStage ( true ) ; } status = true ; return element ; } finally { if ( this . taskProgression != null ) { this . taskProgression . setValue ( this . buffer . position ( ) + HEADER_BYTES ) ; } if ( ! status ) { close ( ) ; postReadingStage ( status ) ; } } }
Read the elements for a shape file .
6,330
protected void setReadingPosition ( int recordIndex , int byteIndex ) throws IOException { if ( this . seekEnabled ) { this . nextExpectedRecordIndex = recordIndex ; this . buffer . position ( byteIndex ) ; } else { throw new SeekOperationDisabledException ( ) ; } }
Set the reading position excluding the header .
6,331
protected void ensureAvailableBytes ( int amount ) throws IOException { if ( ! this . seekEnabled && amount > this . buffer . remaining ( ) ) { this . bufferPosition += this . buffer . position ( ) ; this . buffer . compact ( ) ; int limit = this . buffer . position ( ) ; final int read = this . stream . read ( this . buffer ) ; if ( read < 0 ) { if ( limit == 0 ) { throw new EOFException ( ) ; } } else { limit += read ; } this . buffer . rewind ( ) ; this . buffer . limit ( limit ) ; } if ( amount > this . buffer . remaining ( ) ) { throw new EOFException ( ) ; } }
Ensure that the reading buffer is containing enoug bytes to read .
6,332
protected void skipBytes ( int amount ) throws IOException { ensureAvailableBytes ( amount ) ; this . buffer . position ( this . buffer . position ( ) + amount ) ; }
Skip an amount of bytes .
6,333
public Point2D < ? , ? > predictTargetPosition ( Point2D < ? , ? > targetPosition , Vector2D < ? , ? > targetLinearMotion ) { return new Point2d ( targetPosition . getX ( ) + targetLinearMotion . getX ( ) * this . predictionDuration , targetPosition . getY ( ) + targetLinearMotion . getY ( ) * this . predictionDuration ) ; }
Predict the next position of the target .
6,334
protected void reconnect ( Session session ) { if ( this . hsClient . isStarted ( ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Add reconnectRequest to connector " + session . getRemoteSocketAddress ( ) ) ; } HandlerSocketSession hSession = ( HandlerSocketSession ) session ; InetSocketAddress addr = hSession . getRemoteSocketAddress ( ) ; this . hsClient . getConnector ( ) . addToWatingQueue ( new ReconnectRequest ( addr , 0 , this . hsClient . getHealConnectionInterval ( ) ) ) ; } }
Auto reconect request to hs4j server
6,335
public AStarSegmentReplacer < ST > setSegmentReplacer ( AStarSegmentReplacer < ST > replacer ) { final AStarSegmentReplacer < ST > old = this . segmentReplacer ; this . segmentReplacer = replacer ; return old ; }
Set the object to use to replace the segments in the shortest path .
6,336
public AStarSegmentOrientation < ST , PT > setSegmentOrientationTool ( AStarSegmentOrientation < ST , PT > tool ) { final AStarSegmentOrientation < ST , PT > old = this . segmentOrientation ; this . segmentOrientation = tool ; return old ; }
Set the tool that permits to retreive the orinetation of the segments .
6,337
public AStarCostComputer < ? super ST , ? super PT > setCostComputer ( AStarCostComputer < ? super ST , ? super PT > costComputer ) { final AStarCostComputer < ? super ST , ? super PT > old = this . costComputer ; this . costComputer = costComputer ; return old ; }
Set the tool that permits to compute the costs of the nodes and the edges .
6,338
protected double estimate ( PT p1 , PT p2 ) { assert p1 != null && p2 != null ; if ( this . heuristic == null ) { throw new IllegalStateException ( Locale . getString ( "E1" ) ) ; } return this . heuristic . evaluate ( p1 , p2 ) ; }
Evaluate the distance between two points in the graph .
6,339
protected double computeCostFor ( ST segment ) { if ( this . costComputer != null ) { return this . costComputer . computeCostFor ( segment ) ; } return segment . getLength ( ) ; }
Compute and replies the cost to traverse the given graph segment .
6,340
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) protected GP newPath ( PT startPoint , ST segment ) { if ( this . pathFactory != null ) { return this . pathFactory . newPath ( startPoint , segment ) ; } try { return ( GP ) new GraphPath ( segment , startPoint ) ; } catch ( Throwable e ) { throw new IllegalStateException ( Locale . getString ( "E2" ) , e ) ; } }
Create an empty path .
6,341
protected boolean addToPath ( GP path , ST segment ) { if ( this . pathFactory != null ) { return this . pathFactory . addToPath ( path , segment ) ; } assert path != null ; assert segment != null ; try { return path . add ( segment ) ; } catch ( Throwable e ) { throw new IllegalStateException ( e ) ; } }
Add the given segment into the given path .
6,342
protected ST replaceSegment ( int index , ST segment ) { ST rep = null ; if ( this . segmentReplacer != null ) { rep = this . segmentReplacer . replaceSegment ( index , segment ) ; } if ( rep == null ) { rep = segment ; } return rep ; }
Invoked to replace a segment before adding it to the shortest path .
6,343
public static Vector2d convert ( Tuple2D < ? > tuple ) { if ( tuple instanceof Vector2d ) { return ( Vector2d ) tuple ; } return new Vector2d ( tuple . getX ( ) , tuple . getY ( ) ) ; }
Convert the given tuple to a real Vector2d .
6,344
public boolean addBusLine ( BusLine busLine ) { if ( busLine == null ) { return false ; } if ( this . busLines . indexOf ( busLine ) != - 1 ) { return false ; } if ( ! this . busLines . add ( busLine ) ) { return false ; } final boolean isValidLine = busLine . isValidPrimitive ( ) ; busLine . setEventFirable ( isEventFirable ( ) ) ; busLine . setContainer ( this ) ; if ( isEventFirable ( ) ) { fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . LINE_ADDED , busLine , this . busLines . size ( ) - 1 , "shape" , null , null ) ) ; if ( ! isValidLine ) { revalidate ( ) ; } else { checkPrimitiveValidity ( ) ; } } return true ; }
Add a bus line inside the bus network .
6,345
public void removeAllBusLines ( ) { for ( final BusLine busline : this . busLines ) { busline . setContainer ( null ) ; busline . setEventFirable ( true ) ; } this . busLines . clear ( ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . ALL_LINES_REMOVED , null , - 1 , "shape" , null , null ) ) ; checkPrimitiveValidity ( ) ; }
Remove all the bus lines from the current network .
6,346
public boolean removeBusLine ( BusLine busLine ) { final int index = this . busLines . indexOf ( busLine ) ; if ( index >= 0 ) { return removeBusLine ( index ) ; } return false ; }
Remove a bus line from this network . All the itineraries and the associated stops will be removed also . If this bus line removal implies empty hubs these hubs will be also removed .
6,347
public boolean removeBusLine ( String name ) { final Iterator < BusLine > iterator = this . busLines . iterator ( ) ; BusLine busLine ; int i = 0 ; while ( iterator . hasNext ( ) ) { busLine = iterator . next ( ) ; if ( name . equals ( busLine . getName ( ) ) ) { iterator . remove ( ) ; busLine . setContainer ( null ) ; busLine . setEventFirable ( true ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . LINE_REMOVED , busLine , i , "shape" , null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } ++ i ; } return false ; }
Remove the bus line with the given name . All the itineraries and the associated stops will be removed also . If this bus line removal implies empty hubs these hubs will be also removed .
6,348
public boolean removeBusLine ( int index ) { try { final BusLine busLine = this . busLines . remove ( index ) ; busLine . setContainer ( null ) ; busLine . setEventFirable ( true ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . LINE_REMOVED , busLine , index , "shape" , null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } catch ( Throwable exception ) { } return false ; }
Remove the bus line at the specified index . All the itineraries and the associated stops will be removed also . If this bus line removal implies empty hubs these hubs will be also removed .
6,349
public BusLine getBusLine ( UUID uuid ) { if ( uuid == null ) { return null ; } for ( final BusLine busLine : this . busLines ) { if ( uuid . equals ( busLine . getUUID ( ) ) ) { return busLine ; } } return null ; }
Replies the bus line with the specified uuid .
6,350
public BusLine getBusLine ( String name , Comparator < String > nameComparator ) { if ( name == null ) { return null ; } final Comparator < String > cmp = nameComparator == null ? BusNetworkUtilities . NAME_COMPARATOR : nameComparator ; for ( final BusLine busLine : this . busLines ) { if ( cmp . compare ( name , busLine . getName ( ) ) == 0 ) { return busLine ; } } return null ; }
Replies the bus line with the specified name .
6,351
public boolean addBusStop ( BusStop busStop ) { if ( busStop == null ) { return false ; } if ( this . validBusStops . contains ( busStop ) ) { return false ; } if ( ListUtil . contains ( this . invalidBusStops , INVALID_STOP_COMPARATOR , busStop ) ) { return false ; } final boolean isValidPrimitive = busStop . isValidPrimitive ( ) ; if ( isValidPrimitive ) { if ( ! this . validBusStops . add ( busStop ) ) { return false ; } } else if ( ListUtil . addIfAbsent ( this . invalidBusStops , INVALID_STOP_COMPARATOR , busStop ) < 0 ) { return false ; } busStop . setEventFirable ( isEventFirable ( ) ) ; busStop . setContainer ( this ) ; if ( isEventFirable ( ) ) { fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . STOP_ADDED , busStop , - 1 , "shape" , null , null ) ) ; busStop . checkPrimitiveValidity ( ) ; checkPrimitiveValidity ( ) ; } return true ; }
Add a bus stop inside the bus network .
6,352
public void removeAllBusStops ( ) { for ( final BusStop busStop : this . validBusStops ) { busStop . setContainer ( null ) ; busStop . setEventFirable ( true ) ; } for ( final BusStop busStop : this . invalidBusStops ) { busStop . setContainer ( null ) ; busStop . setEventFirable ( true ) ; } this . validBusStops . clear ( ) ; this . invalidBusStops . clear ( ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . ALL_STOPS_REMOVED , null , - 1 , "shape" , null , null ) ) ; revalidate ( ) ; }
Remove all the bus stops from the current network .
6,353
public boolean removeBusStop ( BusStop busStop ) { if ( this . validBusStops . remove ( busStop ) ) { busStop . setContainer ( null ) ; busStop . setEventFirable ( true ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . STOP_REMOVED , busStop , - 1 , "shape" , null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } final int idx = ListUtil . remove ( this . invalidBusStops , INVALID_STOP_COMPARATOR , busStop ) ; if ( idx >= 0 ) { busStop . setContainer ( null ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . STOP_REMOVED , busStop , - 1 , "shape" , null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } return false ; }
Remove a bus stop from this network . If this bus stop removal implies empty hubs these hubs will be also removed .
6,354
public boolean removeBusStop ( String name ) { Iterator < BusStop > iterator ; BusStop busStop ; iterator = this . validBusStops . iterator ( ) ; while ( iterator . hasNext ( ) ) { busStop = iterator . next ( ) ; if ( name . equals ( busStop . getName ( ) ) ) { iterator . remove ( ) ; busStop . setContainer ( null ) ; busStop . setEventFirable ( true ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . STOP_REMOVED , busStop , - 1 , "shape" , null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } } iterator = this . invalidBusStops . iterator ( ) ; while ( iterator . hasNext ( ) ) { busStop = iterator . next ( ) ; if ( name . equals ( busStop . getName ( ) ) ) { iterator . remove ( ) ; busStop . setContainer ( null ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . STOP_REMOVED , busStop , - 1 , "shape" , null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } } return false ; }
Remove the bus stops with the given name . If this bus stop removal implies empty hubs these hubs will be also removed .
6,355
public BusStop getBusStop ( UUID id ) { if ( id == null ) { return null ; } for ( final BusStop busStop : this . validBusStops ) { final UUID busid = busStop . getUUID ( ) ; if ( id . equals ( busid ) ) { return busStop ; } } for ( final BusStop busStop : this . invalidBusStops ) { final UUID busid = busStop . getUUID ( ) ; if ( id . equals ( busid ) ) { return busStop ; } } return null ; }
Replies the bus stop with the specified id .
6,356
public BusStop getBusStop ( String name , Comparator < String > nameComparator ) { if ( name == null ) { return null ; } final Comparator < String > cmp = nameComparator == null ? BusNetworkUtilities . NAME_COMPARATOR : nameComparator ; for ( final BusStop busStop : this . validBusStops ) { if ( cmp . compare ( name , busStop . getName ( ) ) == 0 ) { return busStop ; } } for ( final BusStop busStop : this . invalidBusStops ) { if ( cmp . compare ( name , busStop . getName ( ) ) == 0 ) { return busStop ; } } return null ; }
Replies the bus stop with the specified name .
6,357
public Iterator < BusStop > getBusStopsIn ( Rectangle2afp < ? , ? , ? , ? , ? , ? > clipBounds ) { return Iterators . unmodifiableIterator ( this . validBusStops . iterator ( clipBounds ) ) ; }
Replies the set of bus stops that have an intersection with the specified rectangle .
6,358
public BusStop getNearestBusStop ( double x , double y ) { double distance = Double . POSITIVE_INFINITY ; BusStop bestStop = null ; double dist ; for ( final BusStop stop : this . validBusStops ) { dist = stop . distance ( x , y ) ; if ( dist < distance ) { distance = dist ; bestStop = stop ; } } return bestStop ; }
Replies the nearest bus stops to the given point .
6,359
private boolean addBusHub ( BusHub hub ) { if ( hub == null ) { return false ; } if ( this . validBusHubs . contains ( hub ) ) { return false ; } if ( ListUtil . contains ( this . invalidBusHubs , INVALID_HUB_COMPARATOR , hub ) ) { return false ; } final boolean isValidPrimitive = hub . isValidPrimitive ( ) ; if ( isValidPrimitive ) { if ( ! this . validBusHubs . add ( hub ) ) { return false ; } } else if ( ListUtil . addIfAbsent ( this . invalidBusHubs , INVALID_HUB_COMPARATOR , hub ) < 0 ) { return false ; } hub . setEventFirable ( isEventFirable ( ) ) ; hub . setContainer ( this ) ; if ( isEventFirable ( ) ) { firePrimitiveChanged ( new BusChangeEvent ( this , BusChangeEventType . HUB_ADDED , hub , - 1 , null , null , null ) ) ; hub . checkPrimitiveValidity ( ) ; checkPrimitiveValidity ( ) ; } return true ; }
Add the given bus hub in the network .
6,360
public void removeAllBusHubs ( ) { for ( final BusHub busHub : this . validBusHubs ) { busHub . setContainer ( null ) ; busHub . setEventFirable ( true ) ; } for ( final BusHub busHub : this . invalidBusHubs ) { busHub . setContainer ( null ) ; busHub . setEventFirable ( true ) ; } this . validBusHubs . clear ( ) ; this . invalidBusHubs . clear ( ) ; firePrimitiveChanged ( new BusChangeEvent ( this , BusChangeEventType . ALL_HUBS_REMOVED , null , - 1 , null , null , null ) ) ; revalidate ( ) ; }
Remove all the bus hubs from the current network .
6,361
public boolean removeBusHub ( BusHub busHub ) { if ( this . validBusHubs . remove ( busHub ) ) { busHub . setContainer ( null ) ; busHub . setEventFirable ( true ) ; firePrimitiveChanged ( new BusChangeEvent ( this , BusChangeEventType . HUB_REMOVED , busHub , - 1 , null , null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } final int idx = ListUtil . remove ( this . invalidBusHubs , INVALID_HUB_COMPARATOR , busHub ) ; if ( idx >= 0 ) { busHub . setContainer ( null ) ; busHub . setEventFirable ( true ) ; firePrimitiveChanged ( new BusChangeEvent ( this , BusChangeEventType . HUB_REMOVED , busHub , - 1 , null , null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } return false ; }
Remove a bus hubs from this network .
6,362
public boolean removeBusHub ( String name ) { Iterator < BusHub > iterator ; BusHub busHub ; iterator = this . validBusHubs . iterator ( ) ; while ( iterator . hasNext ( ) ) { busHub = iterator . next ( ) ; if ( name . equals ( busHub . getName ( ) ) ) { iterator . remove ( ) ; busHub . setContainer ( null ) ; busHub . setEventFirable ( true ) ; firePrimitiveChanged ( new BusChangeEvent ( this , BusChangeEventType . HUB_REMOVED , busHub , - 1 , null , null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } } iterator = this . invalidBusHubs . iterator ( ) ; while ( iterator . hasNext ( ) ) { busHub = iterator . next ( ) ; if ( name . equals ( busHub . getName ( ) ) ) { iterator . remove ( ) ; busHub . setContainer ( null ) ; firePrimitiveChanged ( new BusChangeEvent ( this , BusChangeEventType . HUB_REMOVED , busHub , - 1 , null , null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } } return false ; }
Remove the bus hub with the given name .
6,363
public BusHub getBusHub ( UUID uuid ) { if ( uuid == null ) { return null ; } for ( final BusHub busHub : this . validBusHubs ) { if ( uuid . equals ( busHub . getUUID ( ) ) ) { return busHub ; } } for ( final BusHub busHub : this . invalidBusHubs ) { if ( uuid . equals ( busHub . getUUID ( ) ) ) { return busHub ; } } return null ; }
Replies the bus hub with the specified uuid .
6,364
public BusHub getBusHub ( String name , Comparator < String > nameComparator ) { if ( name == null ) { return null ; } final Comparator < String > cmp = nameComparator == null ? BusNetworkUtilities . NAME_COMPARATOR : nameComparator ; for ( final BusHub busHub : this . validBusHubs ) { if ( cmp . compare ( name , busHub . getName ( ) ) == 0 ) { return busHub ; } } for ( final BusHub busHub : this . invalidBusHubs ) { if ( cmp . compare ( name , busHub . getName ( ) ) == 0 ) { return busHub ; } } return null ; }
Replies the bus hub with the specified name .
6,365
public Iterator < BusHub > getBusHubsIn ( Rectangle2afp < ? , ? , ? , ? , ? , ? > clipBounds ) { return Iterators . unmodifiableIterator ( this . validBusHubs . iterator ( clipBounds ) ) ; }
Replies the set of bus hubs that have an intersection with the specified rectangle .
6,366
public void setValue ( Object instance , Object value ) { try { setMethod . invoke ( instance , value ) ; } catch ( Exception e ) { throw new PropertyNotFoundException ( klass , getType ( ) , fieldName ) ; } }
Set new value
6,367
public static Vector3dfx convert ( Tuple3D < ? > tuple ) { if ( tuple instanceof Vector3dfx ) { return ( Vector3dfx ) tuple ; } return new Vector3dfx ( tuple . getX ( ) , tuple . getY ( ) , tuple . getZ ( ) ) ; }
Convert the given tuple to a real Vector3dfx .
6,368
public void shuffleSelectedRightRowToLeftTableModel ( final int selectedRow ) { if ( - 1 < selectedRow ) { final T row = rightTableModel . removeAt ( selectedRow ) ; leftTableModel . add ( row ) ; } }
Shuffle selected right row to left table model .
6,369
public OffsetGroup startReferenceOffsetsForContentOffset ( CharOffset contentOffset ) { return characterRegions ( ) . get ( regionIndexContainingContentOffset ( contentOffset ) ) . startOffsetGroupForPosition ( contentOffset ) ; }
Get the earliest reference string offsets corresponding to the given content string offset .
6,370
public OffsetGroup endReferenceOffsetsForContentOffset ( CharOffset contentOffset ) { return characterRegions ( ) . get ( regionIndexContainingContentOffset ( contentOffset ) ) . endOffsetGroupForPosition ( contentOffset ) ; }
Get the latest reference string offsets corresponding to the given content string offset .
6,371
public final Optional < UnicodeFriendlyString > referenceSubstringByContentOffsets ( final OffsetRange < CharOffset > contentOffsets ) { if ( referenceString ( ) . isPresent ( ) ) { return Optional . of ( referenceString ( ) . get ( ) . substringByCodePoints ( OffsetGroupRange . from ( startReferenceOffsetsForContentOffset ( contentOffsets . startInclusive ( ) ) , endReferenceOffsetsForContentOffset ( contentOffsets . endInclusive ( ) ) ) . asCharOffsetRange ( ) ) ) ; } else { return Optional . absent ( ) ; } }
Gets the substring of the reference string corresponding to a range of content string offsets . This will include intervening characters which may not themselves correspond to any content string character .
6,372
@ SuppressWarnings ( "checkstyle:localvariablename" ) public int getLatitudeMinute ( ) { double p = Math . abs ( this . phi ) ; p = p - ( int ) p ; return ( int ) ( p * 60. ) ; }
Replies the minute of the sexagesimal representation of the latitude phi .
6,373
@ SuppressWarnings ( "checkstyle:localvariablename" ) public double getLatitudeSecond ( ) { double p = Math . abs ( this . phi ) ; p = ( p - ( int ) p ) * 60. ; p = p - ( int ) p ; return p * 60. ; }
Replies the second of the sexagesimal representation of the latitude phi .
6,374
@ SuppressWarnings ( "checkstyle:localvariablename" ) public int getLongitudeMinute ( ) { double l = Math . abs ( this . lambda ) ; l = l - ( int ) l ; return ( int ) ( l * 60. ) ; }
Replies the minute of the sexagesimal representation of the longitude phi .
6,375
@ SuppressWarnings ( "checkstyle:localvariablename" ) public double getLongitudeSecond ( ) { double p = Math . abs ( this . lambda ) ; p = ( p - ( int ) p ) * 60. ; p = p - ( int ) p ; return p * 60. ; }
Replies the second of the sexagesimal representation of the longitude phi .
6,376
public static void setPreferredStringRepresentation ( GeodesicPositionStringRepresentation representation , boolean useSymbolicDirection ) { final Preferences prefs = Preferences . userNodeForPackage ( GeodesicPosition . class ) ; if ( prefs != null ) { if ( representation == null ) { prefs . remove ( "STRING_REPRESENTATION" ) ; prefs . remove ( "SYMBOL_IN_STRING_REPRESENTATION" ) ; } else { prefs . put ( "STRING_REPRESENTATION" , representation . toString ( ) ) ; prefs . putBoolean ( "SYMBOL_IN_STRING_REPRESENTATION" , useSymbolicDirection ) ; } } }
Set the preferred format of the string representation of a geodesic position .
6,377
public static GeodesicPositionStringRepresentation getPreferredStringRepresentation ( boolean allowNullValue ) { final Preferences prefs = Preferences . userNodeForPackage ( GeodesicPosition . class ) ; if ( prefs != null ) { final String v = prefs . get ( "STRING_REPRESENTATION" , null ) ; if ( v != null && ! "" . equals ( v ) ) { try { GeodesicPositionStringRepresentation rep ; try { rep = GeodesicPositionStringRepresentation . valueOf ( v . toUpperCase ( ) ) ; } catch ( Throwable exception ) { rep = null ; } if ( rep != null ) { return rep ; } } catch ( AssertionError e ) { throw e ; } catch ( Throwable exception ) { } } } if ( allowNullValue ) { return null ; } return DEFAULT_STRING_REPRESENTATION ; }
Replies the preferred format of the string representation of a geodesic position .
6,378
public static boolean getDirectionSymbolInPreferredStringRepresentation ( ) { final Preferences prefs = Preferences . userNodeForPackage ( GeodesicPosition . class ) ; if ( prefs != null ) { return prefs . getBoolean ( "SYMBOL_IN_STRING_REPRESENTATION" , DEFAULT_SYMBOL_IN_STRING_REPRESENTATION ) ; } return DEFAULT_SYMBOL_IN_STRING_REPRESENTATION ; }
Replies if the direction symbol should be output in the preferred string representation of a geodesic position .
6,379
public synchronized void addForestListener ( ForestListener listener ) { if ( this . listeners == null ) { this . listeners = new ArrayList < > ( ) ; } this . listeners . add ( listener ) ; }
Add forest listener .
6,380
public synchronized void removeForestListener ( ForestListener listener ) { if ( this . listeners != null ) { this . listeners . remove ( listener ) ; if ( this . listeners . isEmpty ( ) ) { this . listeners = null ; } } }
Remove forest listener .
6,381
@ SuppressWarnings ( "static-method" ) public Log4jIntegrationConfig getLog4jIntegrationConfig ( ConfigurationFactory configFactory , Injector injector ) { final Log4jIntegrationConfig config = Log4jIntegrationConfig . getConfiguration ( configFactory ) ; injector . injectMembers ( config ) ; return config ; }
Replies the instance of the log4j integration configuration ..
6,382
@ SuppressWarnings ( "static-method" ) public Logger provideRootLogger ( ConfigurationFactory configFactory , Provider < Log4jIntegrationConfig > config ) { final Logger root = Logger . getRootLogger ( ) ; SLF4JBridgeHandler . removeHandlersForRootLogger ( ) ; SLF4JBridgeHandler . install ( ) ; final Log4jIntegrationConfig cfg = config . get ( ) ; if ( ! cfg . getUseLog4jConfig ( ) ) { cfg . configureLogger ( root ) ; } return root ; }
Provide the root logger .
6,383
protected void onInitializeComponents ( ) { lpNoProxy = new JLayeredPane ( ) ; lpNoProxy . setBorder ( new EtchedBorder ( EtchedBorder . RAISED , null , null ) ) ; lpHostOrIpaddress = new JLayeredPane ( ) ; lpHostOrIpaddress . setBorder ( new EtchedBorder ( EtchedBorder . RAISED , null , null ) ) ; rdbtnManualProxyConfiguration = new JRadioButton ( "Manual proxy configuration" ) ; rdbtnManualProxyConfiguration . setBounds ( 6 , 7 , 313 , 23 ) ; lpHostOrIpaddress . add ( rdbtnManualProxyConfiguration ) ; lblHostOrIpaddress = new JLabel ( "Host or IP-address:" ) ; lblHostOrIpaddress . setBounds ( 26 , 37 , 109 , 14 ) ; lpHostOrIpaddress . add ( lblHostOrIpaddress ) ; txtHostOrIpaddress = new JTextField ( ) ; txtHostOrIpaddress . setBounds ( 145 , 37 , 213 , 20 ) ; lpHostOrIpaddress . add ( txtHostOrIpaddress ) ; txtHostOrIpaddress . setColumns ( 10 ) ; lblPort = new JLabel ( "Port:" ) ; lblPort . setBounds ( 368 , 40 , 46 , 14 ) ; lpHostOrIpaddress . add ( lblPort ) ; txtPort = new JTextField ( ) ; txtPort . setBounds ( 408 , 37 , 67 , 20 ) ; lpHostOrIpaddress . add ( txtPort ) ; txtPort . setColumns ( 10 ) ; rdbtnNoProxy = new JRadioButton ( "Direct connection to internet (no proxy)" ) ; rdbtnNoProxy . setBounds ( 6 , 7 , 305 , 23 ) ; lpNoProxy . add ( rdbtnNoProxy ) ; lpUseSystemSettings = new JLayeredPane ( ) ; lpUseSystemSettings . setBorder ( new EtchedBorder ( EtchedBorder . RAISED , null , null ) ) ; rdbtnUseSystemSettings = new JRadioButton ( "Use proxy settings from system" ) ; rdbtnUseSystemSettings . setBounds ( 6 , 7 , 305 , 23 ) ; lpUseSystemSettings . add ( rdbtnUseSystemSettings ) ; btngrpProxySettings = new ButtonGroup ( ) ; btngrpProxySettings . add ( rdbtnNoProxy ) ; btngrpProxySettings . add ( rdbtnManualProxyConfiguration ) ; chckbxSocksProxy = new JCheckBox ( "SOCKS-Proxy?" ) ; chckbxSocksProxy . setToolTipText ( "Is it a SOCKS-Proxy?" ) ; chckbxSocksProxy . setBounds ( 26 , 63 , 97 , 23 ) ; lpHostOrIpaddress . add ( chckbxSocksProxy ) ; btngrpProxySettings . add ( rdbtnUseSystemSettings ) ; }
Initialize components .
6,384
public static Iterator < BusItineraryHalt > getBusHalts ( BusLine busLine ) { assert busLine != null ; return new LineHaltIterator ( busLine ) ; }
Replies all the bus itinerary halts in the given bus line .
6,385
public static Iterator < BusItineraryHalt > getBusHalts ( BusNetwork busNetwork ) { assert busNetwork != null ; return new NetworkHaltIterator ( busNetwork ) ; }
Replies all the bus itinerary halts in the given bus network .
6,386
protected Method getActionMethod ( Class actionClass , String methodName ) throws NoSuchMethodException { Method method ; try { method = actionClass . getMethod ( methodName , new Class [ 0 ] ) ; } catch ( NoSuchMethodException e ) { try { String altMethodName = "do" + methodName . substring ( 0 , 1 ) . toUpperCase ( ) + methodName . substring ( 1 ) ; method = actionClass . getMethod ( altMethodName , new Class [ 0 ] ) ; } catch ( NoSuchMethodException e1 ) { throw e ; } } return method ; }
This is copied from DefaultActionInvocation
6,387
private String cutYear ( String str ) { if ( str . length ( ) > 3 ) { return str . substring ( str . length ( ) - 3 , str . length ( ) ) ; } else { return str ; } }
Remove the 2 - bit year number from input date string
6,388
public Point3d getPivot ( ) { Point3d pivot = this . cachedPivot == null ? null : this . cachedPivot . get ( ) ; if ( pivot == null ) { pivot = getProjection ( 0. , 0. , 0. ) ; this . cachedPivot = new WeakReference < > ( pivot ) ; } return pivot ; }
Replies the pivot point around which the rotation must be done .
6,389
private static String decodeHTMLEntities ( String string ) { if ( string == null ) { return null ; } try { return URLDecoder . decode ( string , Charset . defaultCharset ( ) . displayName ( ) ) ; } catch ( UnsupportedEncodingException exception ) { return string ; } }
Replace the HTML entities by the current charset characters .
6,390
private static String encodeHTMLEntities ( String string ) { if ( string == null ) { return null ; } try { return URLEncoder . encode ( string , Charset . defaultCharset ( ) . displayName ( ) ) ; } catch ( UnsupportedEncodingException exception ) { return string ; } }
Replace the special characters by HTML entities .
6,391
@ Inline ( value = "URISchemeType.JAR.isURL($1)" , imported = { URISchemeType . class } ) public static boolean isJarURL ( URL url ) { return URISchemeType . JAR . isURL ( url ) ; }
Replies if the given URL has a jar scheme .
6,392
public static URL getJarURL ( URL url ) { if ( ! isJarURL ( url ) ) { return null ; } String path = url . getPath ( ) ; final int idx = path . lastIndexOf ( JAR_URL_FILE_ROOT ) ; if ( idx >= 0 ) { path = path . substring ( 0 , idx ) ; } try { return new URL ( path ) ; } catch ( MalformedURLException exception ) { return null ; } }
Replies the jar part of the jar - scheme URL .
6,393
public static File getJarFile ( URL url ) { if ( isJarURL ( url ) ) { final String path = url . getPath ( ) ; final int idx = path . lastIndexOf ( JAR_URL_FILE_ROOT ) ; if ( idx >= 0 ) { return new File ( decodeHTMLEntities ( path . substring ( idx + 1 ) ) ) ; } } return null ; }
Replies the file part of the jar - scheme URL .
6,394
public static boolean isCaseSensitiveFilenameSystem ( ) { switch ( OperatingSystem . getCurrentOS ( ) ) { case AIX : case ANDROID : case BSD : case FREEBSD : case NETBSD : case OPENBSD : case LINUX : case SOLARIS : case HPUX : return true ; default : return false ; } }
Replies if the current operating system uses case - sensitive filename .
6,395
public static String extension ( File filename ) { if ( filename == null ) { return null ; } final String largeBasename = largeBasename ( filename ) ; final int idx = largeBasename . lastIndexOf ( getFileExtensionCharacter ( ) ) ; if ( idx <= 0 ) { return "" ; } return largeBasename . substring ( idx ) ; }
Reply the extension of the specified file .
6,396
public static boolean hasExtension ( File filename , String extension ) { if ( filename == null ) { return false ; } assert extension != null ; String extent = extension ; if ( ! "" . equals ( extent ) && ! extent . startsWith ( EXTENSION_SEPARATOR ) ) { extent = EXTENSION_SEPARATOR + extent ; } final String ext = extension ( filename ) ; if ( ext == null ) { return false ; } if ( isCaseSensitiveFilenameSystem ( ) ) { return ext . equals ( extent ) ; } return ext . equalsIgnoreCase ( extent ) ; }
Replies if the specified file has the specified extension .
6,397
public static File getSystemConfigurationDirectoryFor ( String software ) { if ( software == null || "" . equals ( software ) ) { throw new IllegalArgumentException ( ) ; } final OperatingSystem os = OperatingSystem . getCurrentOS ( ) ; if ( os == OperatingSystem . ANDROID ) { return join ( File . listRoots ( ) [ 0 ] , Android . CONFIGURATION_DIRECTORY , Android . makeAndroidApplicationName ( software ) ) ; } else if ( os . isUnixCompliant ( ) ) { final File [ ] roots = File . listRoots ( ) ; return join ( roots [ 0 ] , "etc" , software ) ; } else if ( os == OperatingSystem . WIN ) { File pfDirectory ; for ( final File root : File . listRoots ( ) ) { pfDirectory = new File ( root , "Program Files" ) ; if ( pfDirectory . isDirectory ( ) ) { return new File ( root , software ) ; } } } return null ; }
Replies the system configuration directory for the specified software .
6,398
public static String getSystemSharedLibraryDirectoryNameFor ( String software ) { final File f = getSystemSharedLibraryDirectoryFor ( software ) ; if ( f == null ) { return null ; } return f . getAbsolutePath ( ) ; }
Replies the system shared library directory for the specified software .
6,399
public static File convertStringToFile ( String filename ) { if ( filename == null || "" . equals ( filename ) ) { return null ; } if ( isWindowsNativeFilename ( filename ) ) { return normalizeWindowsNativeFilename ( filename ) ; } return new File ( extractLocalPath ( filename ) . replaceAll ( Pattern . quote ( UNIX_SEPARATOR_STRING ) , Matcher . quoteReplacement ( File . separator ) ) ) ; }
Convert a string which represents a local file into a File .