idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
6,000 | public boolean contains ( FunctionalPoint3D point ) { return containsTrianglePoint ( this . getP1 ( ) . getX ( ) , this . getP1 ( ) . getY ( ) , this . getP1 ( ) . getZ ( ) , this . getP2 ( ) . getX ( ) , this . getP2 ( ) . getY ( ) , this . getP2 ( ) . getZ ( ) , this . getP3 ( ) . getX ( ) , this . getP3 ( ) . getY (... | Checks if a point is inside this triangle . |
6,001 | public Plane3D < ? > getPlane ( ) { return toPlane ( getX1 ( ) , getY1 ( ) , getZ1 ( ) , getX1 ( ) , getY1 ( ) , getZ1 ( ) , getX1 ( ) , getY1 ( ) , getZ1 ( ) ) ; } | Replies the plane on which this triangle is coplanar . |
6,002 | public void writeln ( String text ) throws IOException { this . writer . write ( text ) ; if ( text != null && text . length ( ) > 0 ) { this . writer . write ( "\n" ) ; } } | Write a sequence of characters followed by a carriage return . |
6,003 | public static < X , Y > Iterable < ZipPair < X , Y > > zip ( final Iterable < X > iter1 , final Iterable < Y > iter2 ) { return new ZipIterable < X , Y > ( iter1 , iter2 ) ; } | An implementation of Python s zip . |
6,004 | public static < A , B > B reduce ( final Iterable < A > iterable , final B initial , final Function2 < A , B > func ) { B b = initial ; for ( final A item : iterable ) { b = func . apply ( b , item ) ; } return b ; } | reduces an iterable to a single value starting from an initial value and applying down the iterable . |
6,005 | public static < K , V > ImmutableMap < K , V > mapFromPairedKeyValueSequences ( final Iterable < K > keys , final Iterable < V > values ) { final ImmutableMap . Builder < K , V > builder = ImmutableMap . builder ( ) ; for ( final ZipPair < K , V > pair : zip ( keys , values ) ) { builder . put ( pair . first ( ) , pair... | Given a paired sequence of Iterables produce a map with keys from the first and values from the second . An exception will be raised if the Iterables have different numbers of elements or if there are multiple mappings for the same key . |
6,006 | public static < T > boolean allTheSame ( final Iterable < T > iterable ) { if ( Iterables . isEmpty ( iterable ) ) { return true ; } final T reference = Iterables . getFirst ( iterable , null ) ; for ( final T x : iterable ) { if ( ! x . equals ( reference ) ) { return false ; } } return true ; } | Prefer allEqual whose name is less ambiguous between equality and identity |
6,007 | public static Vector1dfx convert ( Tuple1dfx < ? > tuple ) { if ( tuple instanceof Vector1dfx ) { return ( Vector1dfx ) tuple ; } return new Vector1dfx ( tuple . getSegment ( ) , tuple . getX ( ) , tuple . getY ( ) ) ; } | Convert the given tuple to a real Vector1dfx . |
6,008 | protected boolean buildGetParams ( StringBuilder sb , boolean isFirst ) { BuilderListener listener = mListener ; if ( listener != null ) { return listener . onBuildGetParams ( sb , isFirst ) ; } else { return isFirst ; } } | In this we should add same default params to the get builder |
6,009 | private ProxyType extendedProxyTypeAsProxyType ( ExtendedProxyType pt ) { switch ( pt ) { case DRAFT_RFC : return ProxyType . DRAFT_RFC ; case LEGACY : return ProxyType . LEGACY ; case RFC3820 : return ProxyType . RFC3820 ; default : return null ; } } | Why we have to do this nonsense? |
6,010 | @ SuppressWarnings ( "checkstyle:magicnumber" ) public static String encodeBase26 ( int number ) { final StringBuilder value = new StringBuilder ( ) ; int code = number ; do { final int rest = code % 26 ; value . insert ( 0 , ( char ) ( 'A' + rest ) ) ; code = code / 26 - 1 ; } while ( code >= 0 ) ; return value . toSt... | Replies a base 26 encoding string for the given number . |
6,011 | @ SuppressWarnings ( "checkstyle:npathcomplexity" ) public static Map < Character , String > getJavaToHTMLTranslationTable ( ) { Map < Character , String > map = null ; try { LOCK . lock ( ) ; if ( javaToHtmlTransTbl != null ) { map = javaToHtmlTransTbl . get ( ) ; } } finally { LOCK . unlock ( ) ; } if ( map != null )... | Replies the java - to - html s translation table . |
6,012 | @ SuppressWarnings ( "checkstyle:magicnumber" ) public static String parseHTML ( String html ) { if ( html == null ) { return null ; } final Map < String , Integer > transTbl = getHtmlToJavaTranslationTable ( ) ; assert transTbl != null ; if ( transTbl . isEmpty ( ) ) { return html ; } final Pattern pattern = Pattern .... | Parse the given HTML text and replace all the HTML entities by the corresponding unicode character . |
6,013 | public static String toHTML ( String text ) { if ( text == null ) { return null ; } final Map < Character , String > transTbl = getJavaToHTMLTranslationTable ( ) ; assert transTbl != null ; if ( transTbl . isEmpty ( ) ) { return text ; } final StringBuilder patternStr = new StringBuilder ( ) ; for ( final Character c :... | Translate all the special character from the given text to their equivalent HTML entities . |
6,014 | public static void cutStringAsArray ( String text , CutStringCritera critera , List < String > output ) { cutStringAlgo ( text , critera , new CutStringToArray ( output ) ) ; } | Format the text to be sure that each line is not more longer than the specified critera . |
6,015 | public static char getMnemonicChar ( String text ) { if ( text != null ) { final int pos = text . indexOf ( '&' ) ; if ( ( pos != - 1 ) && ( pos < text . length ( ) - 1 ) ) { return text . charAt ( pos + 1 ) ; } } return '\0' ; } | Replies the character which follow the first & ; . |
6,016 | public static String removeMnemonicChar ( String text ) { if ( text == null ) { return text ; } return text . replaceFirst ( "&" , "" ) ; } | Remove the mnemonic char from the specified string . |
6,017 | @ SuppressWarnings ( "checkstyle:npathcomplexity" ) public static Map < Character , String > getAccentTranslationTable ( ) { Map < Character , String > map = null ; try { LOCK . lock ( ) ; if ( accentTransTbl != null ) { map = accentTransTbl . get ( ) ; } } finally { LOCK . unlock ( ) ; } if ( map != null ) { return ma... | Replies the accent s translation table . |
6,018 | public static String removeAccents ( String text ) { final Map < Character , String > map = getAccentTranslationTable ( ) ; if ( ( map == null ) || ( map . isEmpty ( ) ) ) { return text ; } return removeAccents ( text , map ) ; } | Remove the accents inside the specified string . |
6,019 | public static String [ ] split ( char leftSeparator , char rightSeparator , String str ) { final SplitSeparatorToArrayAlgorithm algo = new SplitSeparatorToArrayAlgorithm ( ) ; splitSeparatorAlgorithm ( leftSeparator , rightSeparator , str , algo ) ; return algo . toArray ( ) ; } | Split the given string according to the separators . The separators are used to delimit the groups of characters . |
6,020 | public static < T > String join ( char leftSeparator , char rightSeparator , @ SuppressWarnings ( "unchecked" ) T ... strs ) { final StringBuilder buffer = new StringBuilder ( ) ; for ( final Object s : strs ) { buffer . append ( leftSeparator ) ; if ( s != null ) { buffer . append ( s . toString ( ) ) ; } buffer . app... | Merge the given strings with to separators . The separators are used to delimit the groups of characters . |
6,021 | public static String toUpperCaseWithoutAccent ( String text , Map < Character , String > map ) { final StringBuilder buffer = new StringBuilder ( ) ; for ( final char c : text . toCharArray ( ) ) { final String trans = map . get ( c ) ; if ( trans != null ) { buffer . append ( trans . toUpperCase ( ) ) ; } else { buffe... | Translate the specified string to upper case and remove the accents . |
6,022 | public static String formatDouble ( double amount , int decimalCount ) { final int dc = ( decimalCount < 0 ) ? 0 : decimalCount ; final StringBuilder str = new StringBuilder ( "#0" ) ; if ( dc > 0 ) { str . append ( '.' ) ; for ( int i = 0 ; i < dc ; ++ i ) { str . append ( '0' ) ; } } final DecimalFormat fmt = new Dec... | Format the given double value . |
6,023 | public static int getLevenshteinDistance ( String firstString , String secondString ) { final String s0 = firstString == null ? "" : firstString ; final String s1 = secondString == null ? "" : secondString ; final int len0 = s0 . length ( ) + 1 ; final int len1 = s1 . length ( ) + 1 ; int [ ] cost = new int [ len0 ] ; ... | Compute the Levenshstein distance between two strings . |
6,024 | public static String toJavaString ( String text ) { final StringEscaper escaper = new StringEscaper ( ) ; return escaper . escape ( text ) ; } | Translate the given string to its Java string equivalent . All the special characters will be escaped . The enclosing double quote characters are not added . |
6,025 | public static String toJsonString ( String text ) { final StringEscaper escaper = new StringEscaper ( StringEscaper . JAVA_ESCAPE_CHAR , StringEscaper . JAVA_STRING_CHAR , StringEscaper . JAVA_ESCAPE_CHAR , StringEscaper . JSON_SPECIAL_ESCAPED_CHAR ) ; return escaper . escape ( text ) ; } | Translate the given string to its Json string equivalent . All the special characters will be escaped . The enclosing double quote characters are not added . |
6,026 | public static VariableDecls extend ( Binder binder ) { return new VariableDecls ( io . bootique . BQCoreModule . extend ( binder ) ) ; } | Create an extended from the given binder . |
6,027 | public VariableDecls declareVar ( String bootiqueVariable ) { this . extender . declareVar ( bootiqueVariable , VariableNames . toEnvironmentVariableName ( bootiqueVariable ) ) ; return this ; } | Declare an environment variable which is linked to the given Bootique variable and has its name defined from the name of the Bootique variable . |
6,028 | protected void initializeElements ( ) { final BusItinerary itinerary = getBusItinerary ( ) ; if ( itinerary != null ) { int i = 0 ; for ( final BusItineraryHalt halt : itinerary . busHalts ( ) ) { onBusItineraryHaltAdded ( halt , i , null ) ; ++ i ; } } } | Run the initialization of the elements from the current bus itinerary . |
6,029 | @ SuppressWarnings ( "unchecked" ) protected static < VALUET > VALUET maskNull ( VALUET value ) { return ( value == null ) ? ( VALUET ) NULL_VALUE : value ; } | Mask the null values given by the used of this map . |
6,030 | protected static < VALUET > VALUET unmaskNull ( VALUET value ) { return ( value == NULL_VALUE ) ? null : value ; } | Unmask the null values given by the used of this map . |
6,031 | @ SuppressWarnings ( "unchecked" ) static < T > T [ ] finishToArray ( T [ ] array , Iterator < ? > it ) { T [ ] rp = array ; int i = rp . length ; while ( it . hasNext ( ) ) { final int cap = rp . length ; if ( i == cap ) { int newCap = ( ( cap / 2 ) + 1 ) * 3 ; if ( newCap <= cap ) { if ( cap == Integer . MAX_VALUE ) ... | Reallocates the array being used within toArray when the iterator returned more elements than expected and finishes filling it from the iterator . |
6,032 | protected final ReferencableValue < K , V > makeValue ( K key , V value ) { return makeValue ( key , value , this . queue ) ; } | Create a storage object that permits to put the specified elements inside this map . |
6,033 | public static String getFirstFreeBusItineraryName ( BusLine busline ) { if ( busline == null ) { return null ; } int nb = busline . getBusItineraryCount ( ) ; String name ; do { ++ nb ; name = Locale . getString ( "NAME_TEMPLATE" , Integer . toString ( nb ) ) ; } while ( busline . getBusItinerary ( name ) != null ) ; r... | Replies a bus itinerary name that was not exist in the specified bus line . |
6,034 | public void invert ( ) { final boolean isEventFirable = isEventFirable ( ) ; setEventFirable ( false ) ; try { final int count = this . roadSegments . getRoadSegmentCount ( ) ; this . roadSegments . invert ( ) ; final int middle = this . validHalts . size ( ) / 2 ; for ( int i = 0 , j = this . validHalts . size ( ) - 1... | Invert the order of this itinerary . |
6,035 | public boolean hasBusHaltOnSegment ( RoadSegment segment ) { if ( this . roadSegments . isEmpty ( ) || this . validHalts . isEmpty ( ) ) { return false ; } int cIdxSegment ; int lIdxSegment = - 1 ; RoadSegment cSegment ; for ( final BusItineraryHalt bushalt : this . validHalts ) { cIdxSegment = bushalt . getRoadSegment... | Replies if the given segment has a bus halt on it . |
6,036 | public List < BusItineraryHalt > getBusHaltsOnSegment ( RoadSegment segment ) { if ( this . roadSegments . isEmpty ( ) || this . validHalts . isEmpty ( ) ) { return Collections . emptyList ( ) ; } int cIdxSegment ; int lIdxSegment = - 1 ; int sIdxSegment = - 1 ; RoadSegment cSegment ; final List < BusItineraryHalt > ha... | Replies the bus halts on the given segment . |
6,037 | public Map < BusItineraryHalt , Pair < Integer , Double > > getBusHaltBinding ( ) { final Comparator < BusItineraryHalt > comp = ( elt1 , elt2 ) -> { if ( elt1 == elt2 ) { return 0 ; } if ( elt1 == null ) { return - 1 ; } if ( elt2 == null ) { return 1 ; } return elt1 . getName ( ) . compareTo ( elt2 . getName ( ) ) ; ... | Replies the binding informations for all the bus halts of this itinerary . |
6,038 | public void setBusHaltBinding ( Map < BusItineraryHalt , Pair < Integer , Float > > binding ) { if ( binding != null ) { BusItineraryHalt halt ; boolean shapeChanged = false ; for ( final Entry < BusItineraryHalt , Pair < Integer , Float > > entry : binding . entrySet ( ) ) { halt = entry . getKey ( ) ; halt . setRoadS... | Set the binding informations for all the bus halts of this itinerary . |
6,039 | public double getLength ( ) { double length = this . roadSegments . getLength ( ) ; if ( isValidPrimitive ( ) ) { BusItineraryHalt halt = this . validHalts . get ( 0 ) ; assert halt != null ; RoadSegment sgmt = halt . getRoadSegment ( ) ; assert sgmt != null ; Direction1D dir = this . roadSegments . getRoadSegmentDirec... | Replies the length of this itinerary . |
6,040 | public double getDistanceBetweenBusHalts ( int firsthaltIndex , int lasthaltIndex ) { if ( firsthaltIndex < 0 || firsthaltIndex >= this . validHalts . size ( ) - 1 ) { throw new ArrayIndexOutOfBoundsException ( firsthaltIndex ) ; } if ( lasthaltIndex <= firsthaltIndex || lasthaltIndex >= this . validHalts . size ( ) ) ... | Replies the distance between two bus halt . |
6,041 | boolean addBusHalt ( BusItineraryHalt halt , int insertToIndex ) { if ( insertToIndex < 0 ) { halt . setInvalidListIndex ( this . insertionIndex ) ; } else { halt . setInvalidListIndex ( insertToIndex ) ; } if ( halt . isValidPrimitive ( ) ) { ListUtil . addIfAbsent ( this . validHalts , VALID_HALT_COMPARATOR , halt ) ... | Add the given bus halt in this itinerary . |
6,042 | public void removeAllBusHalts ( ) { for ( final BusItineraryHalt bushalt : this . invalidHalts ) { bushalt . setContainer ( null ) ; bushalt . setRoadSegmentIndex ( - 1 ) ; bushalt . setPositionOnSegment ( Float . NaN ) ; bushalt . checkPrimitiveValidity ( ) ; } final BusItineraryHalt [ ] halts = new BusItineraryHalt [... | Remove all the bus halts from the current itinerary . |
6,043 | public boolean removeBusHalt ( BusItineraryHalt bushalt ) { try { int index = ListUtil . indexOf ( this . validHalts , VALID_HALT_COMPARATOR , bushalt ) ; if ( index >= 0 ) { return removeBusHalt ( index ) ; } index = ListUtil . indexOf ( this . invalidHalts , INVALID_HALT_COMPARATOR , bushalt ) ; if ( index >= 0 ) { i... | Remove a bus bus from this itinerary . |
6,044 | public boolean removeBusHalt ( String name ) { Iterator < BusItineraryHalt > iterator = this . validHalts . iterator ( ) ; BusItineraryHalt bushalt ; int i = 0 ; while ( iterator . hasNext ( ) ) { bushalt = iterator . next ( ) ; if ( name . equals ( bushalt . getName ( ) ) ) { return removeBusHalt ( i ) ; } ++ i ; } it... | Remove the bus halt with the given name . |
6,045 | public boolean removeBusHalt ( int index ) { try { final BusItineraryHalt removedBushalt ; if ( index < this . validHalts . size ( ) ) { removedBushalt = this . validHalts . remove ( index ) ; } else { final int idx = index - this . validHalts . size ( ) ; removedBushalt = this . invalidHalts . remove ( idx ) ; } remov... | Remove the bus halt at the specified index . |
6,046 | public int indexOf ( BusItineraryHalt bushalt ) { if ( bushalt == null ) { return - 1 ; } if ( bushalt . isValidPrimitive ( ) ) { return ListUtil . indexOf ( this . validHalts , VALID_HALT_COMPARATOR , bushalt ) ; } int idx = ListUtil . indexOf ( this . invalidHalts , INVALID_HALT_COMPARATOR , bushalt ) ; if ( idx >= 0... | Replies the index of the specified bus halt . |
6,047 | public boolean contains ( BusItineraryHalt bushalt ) { if ( bushalt == null ) { return false ; } if ( bushalt . isValidPrimitive ( ) ) { return ListUtil . contains ( this . validHalts , VALID_HALT_COMPARATOR , bushalt ) ; } return ListUtil . contains ( this . invalidHalts , INVALID_HALT_COMPARATOR , bushalt ) ; } | Replies if the given bus halt is inside this bus itinerary . |
6,048 | public BusItineraryHalt getBusHaltAt ( int index ) { if ( index < this . validHalts . size ( ) ) { return this . validHalts . get ( index ) ; } return this . invalidHalts . get ( index - this . validHalts . size ( ) ) ; } | Replies the halt at the specified index . |
6,049 | public BusItineraryHalt getBusHalt ( UUID uuid ) { if ( uuid == null ) { return null ; } for ( final BusItineraryHalt busHalt : this . validHalts ) { if ( uuid . equals ( busHalt . getUUID ( ) ) ) { return busHalt ; } } for ( final BusItineraryHalt busHalt : this . invalidHalts ) { if ( uuid . equals ( busHalt . getUUI... | Replies the bus halt with the specified uuid . |
6,050 | public BusItineraryHalt getBusHalt ( String name , Comparator < String > nameComparator ) { if ( name == null ) { return null ; } final Comparator < String > cmp = nameComparator == null ? BusNetworkUtilities . NAME_COMPARATOR : nameComparator ; for ( final BusItineraryHalt bushalt : this . validHalts ) { if ( cmp . co... | Replies the bus halt with the specified name . |
6,051 | public BusItineraryHalt [ ] toBusHaltArray ( ) { final BusItineraryHalt [ ] tab = new BusItineraryHalt [ this . validHalts . size ( ) + this . invalidHalts . size ( ) ] ; int i = 0 ; for ( final BusItineraryHalt h : this . validHalts ) { tab [ i ] = h ; ++ i ; } for ( final BusItineraryHalt h : this . invalidHalts ) { ... | Replies an array of the bus halts inside this itinerary . This function copy the internal data structures into the array . |
6,052 | public BusItineraryHalt [ ] toInvalidBusHaltArray ( ) { final BusItineraryHalt [ ] tab = new BusItineraryHalt [ this . invalidHalts . size ( ) ] ; return this . invalidHalts . toArray ( tab ) ; } | Replies an array of the invalid bus halts inside this itinerary . This function copy the internal data structures into the array . |
6,053 | public BusItineraryHalt [ ] toValidBusHaltArray ( ) { final BusItineraryHalt [ ] tab = new BusItineraryHalt [ this . validHalts . size ( ) ] ; return this . validHalts . toArray ( tab ) ; } | Replies an array of the valid bus halts inside this itinerary . This function copy the internal data structures into the array . |
6,054 | public RoadSegment getNearestRoadSegment ( Point2D < ? , ? > point ) { assert point != null ; double distance = Double . MAX_VALUE ; RoadSegment nearestSegment = null ; final Iterator < RoadSegment > iterator = this . roadSegments . roadSegments ( ) ; RoadSegment segment ; while ( iterator . hasNext ( ) ) { segment = i... | Replies the nearest road segment from this itinerary to the given point . |
6,055 | public boolean addRoadSegments ( RoadPath segments , boolean autoConnectHalts , boolean enableLoopAutoBuild ) { if ( segments == null || segments . isEmpty ( ) ) { return false ; } BusItineraryHalt halt ; RoadSegment sgmt ; final Map < BusItineraryHalt , RoadSegment > haltMapping = new TreeMap < > ( ( obj1 , obj2 ) -> ... | Add road segments inside the bus itinerary . |
6,056 | @ SuppressWarnings ( "checkstyle:nestedifdepth" ) public boolean putHaltOnRoad ( BusItineraryHalt halt , RoadSegment road ) { if ( contains ( halt ) ) { final BusStop stop = halt . getBusStop ( ) ; if ( stop != null ) { final Point2d stopPosition = stop . getPosition2D ( ) ; if ( stopPosition != null ) { final int idx ... | Put the given bus itinerary halt on the nearest point on road . |
6,057 | public void removeAllRoadSegments ( ) { for ( final BusItineraryHalt halt : this . invalidHalts ) { halt . setRoadSegmentIndex ( - 1 ) ; halt . setPositionOnSegment ( Float . NaN ) ; halt . checkPrimitiveValidity ( ) ; } final BusItineraryHalt [ ] halts = new BusItineraryHalt [ this . validHalts . size ( ) ] ; this . v... | Remove all the road segments from the current itinerary . |
6,058 | public boolean removeRoadSegment ( int segmentIndex ) { if ( segmentIndex >= 0 && segmentIndex < this . roadSegments . getRoadSegmentCount ( ) ) { final RoadSegment segment = this . roadSegments . getRoadSegmentAt ( segmentIndex ) ; if ( segment != null ) { final Map < BusItineraryHalt , RoadSegment > segmentMap = new ... | Remove a road segment from this itinerary . |
6,059 | public Iterable < RoadSegment > roadSegments ( ) { return new Iterable < RoadSegment > ( ) { public Iterator < RoadSegment > iterator ( ) { return roadSegmentsIterator ( ) ; } } ; } | Replies the list of the road segments of the bus itinerary . |
6,060 | @ SuppressWarnings ( "unchecked" ) public static < InT , EqClass > EquivalenceBasedProvenancedAligner < InT , InT , EqClass > forEquivalenceFunction ( Function < ? super InT , ? extends EqClass > equivalenceFunction ) { return new EquivalenceBasedProvenancedAligner < InT , InT , EqClass > ( ( Function < InT , EqClass >... | we don t need |
6,061 | public static String getExecutableFilename ( String name ) { if ( OperatingSystem . WIN . isCurrentOS ( ) ) { return name + ".exe" ; } return name ; } | Replies a binary executable filename depending of the current platform . |
6,062 | public static String getVMBinary ( ) { final String javaHome = System . getProperty ( "java.home" ) ; final File binDir = new File ( new File ( javaHome ) , "bin" ) ; if ( binDir . isDirectory ( ) ) { File exec = new File ( binDir , getExecutableFilename ( "javaw" ) ) ; if ( exec . isFile ( ) ) { return exec . getAbsol... | Replies the current java VM binary . |
6,063 | @ SuppressWarnings ( "checkstyle:magicnumber" ) public static Process launchVMWithJar ( File jarFile , String ... additionalParams ) throws IOException { final String javaBin = getVMBinary ( ) ; if ( javaBin == null ) { throw new FileNotFoundException ( "java" ) ; } final long totalMemory = Runtime . getRuntime ( ) . m... | Run a jar file inside a new VM . |
6,064 | @ SuppressWarnings ( { "checkstyle:cyclomaticcomplexity" , "checkstyle:npathcomplexity" } ) public static String [ ] getAllCommandLineParameters ( ) { final int osize = commandLineOptions == null ? 0 : commandLineOptions . size ( ) ; final int psize = commandLineParameters == null ? 0 : commandLineParameters . length ;... | Replies the command line including the options and the standard parameters . |
6,065 | public static String shiftCommandLineParameters ( ) { String removed = null ; if ( commandLineParameters != null ) { if ( commandLineParameters . length == 0 ) { commandLineParameters = null ; } else if ( commandLineParameters . length == 1 ) { removed = commandLineParameters [ 0 ] ; commandLineParameters = null ; } el... | Shift the command line parameters by one on the left . The first parameter is removed from the list . |
6,066 | public static Map < String , List < Object > > getCommandLineOptions ( ) { if ( commandLineOptions != null ) { return Collections . unmodifiableSortedMap ( commandLineOptions ) ; } return Collections . emptyMap ( ) ; } | Replies the command line options . |
6,067 | public static List < Object > getCommandLineOption ( String name ) { if ( commandLineOptions != null && commandLineOptions . containsKey ( name ) ) { final List < Object > value = commandLineOptions . get ( name ) ; return value == null ? Collections . emptyList ( ) : value ; } return Collections . emptyList ( ) ; } | Replies one command option . |
6,068 | @ SuppressWarnings ( "static-method" ) public Object getFirstOptionValue ( String optionLabel ) { final List < Object > options = getCommandLineOption ( optionLabel ) ; if ( options == null || options . isEmpty ( ) ) { return null ; } return options . get ( 0 ) ; } | Replies the first value of the option . |
6,069 | @ SuppressWarnings ( "static-method" ) public List < Object > getOptionValues ( String optionLabel ) { final List < Object > options = getCommandLineOption ( optionLabel ) ; if ( options == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableList ( options ) ; } | Replies the values of the option . |
6,070 | @ SuppressWarnings ( "static-method" ) public boolean isParameterExists ( int index ) { final String [ ] params = getCommandLineParameters ( ) ; return index >= 0 && index < params . length && params [ index ] != null ; } | Replies if the given index corresponds to a command line parameter . |
6,071 | private int firstInGroup ( int groupIndex ) { if ( this . pointCoordinates == null ) { throw new IndexOutOfBoundsException ( ) ; } final int count = getGroupCount ( ) ; if ( groupIndex < 0 ) { throw new IndexOutOfBoundsException ( groupIndex + "<0" ) ; } if ( groupIndex >= count ) { throw new IndexOutOfBoundsException ... | Replies the starting index of a point in a group . |
6,072 | private int lastInGroup ( int groupIndex ) { if ( this . pointCoordinates == null ) { throw new IndexOutOfBoundsException ( ) ; } final int count = getGroupCount ( ) ; if ( groupIndex < 0 ) { throw new IndexOutOfBoundsException ( groupIndex + "<0" ) ; } if ( groupIndex >= count ) { throw new IndexOutOfBoundsException (... | Replies the ending index of a point in a group . |
6,073 | private int groupIndexForPoint ( int pointIndex ) { if ( this . pointCoordinates == null || pointIndex < 0 || pointIndex >= this . pointCoordinates . length ) { throw new IndexOutOfBoundsException ( ) ; } if ( this . partIndexes == null ) { return 0 ; } for ( int i = 0 ; i < this . partIndexes . length ; ++ i ) { if ( ... | Replies the group index inside which the point is located at the specified index . |
6,074 | public int getPointCountInGroup ( int groupIndex ) { if ( groupIndex == 0 && this . pointCoordinates == null ) { return 0 ; } final int firstInGroup = firstInGroup ( groupIndex ) ; final int lastInGroup = lastInGroup ( groupIndex ) ; return ( lastInGroup - firstInGroup ) / 2 + 1 ; } | Replies the count of points in the specified group . |
6,075 | public int getPointIndex ( int groupIndex , int position ) { final int groupMemberCount = getPointCountInGroup ( groupIndex ) ; final int pos ; if ( position < 0 ) { pos = 0 ; } else if ( position >= groupMemberCount ) { pos = groupMemberCount - 1 ; } else { pos = position ; } return ( firstInGroup ( groupIndex ) + pos... | Replies the global index of the point that corresponds to the position in the given group . |
6,076 | public int getPointIndex ( int groupIndex , Point2D < ? , ? > point2d ) { if ( ! this . containsPoint ( point2d , groupIndex ) ) { return - 1 ; } Point2d cur = null ; int pos = - 1 ; for ( int i = 0 ; i < getPointCountInGroup ( groupIndex ) ; ++ i ) { cur = getPointAt ( groupIndex , i ) ; if ( cur . epsilonEquals ( poi... | Replies the global index of the point2d in the given group . |
6,077 | public PointGroup getGroupAt ( int index ) { final int count = getGroupCount ( ) ; if ( index < 0 ) { throw new IndexOutOfBoundsException ( index + "<0" ) ; } if ( index >= count ) { throw new IndexOutOfBoundsException ( index + ">=" + count ) ; } return new PointGroup ( index ) ; } | Replies the part at the specified index . |
6,078 | public Iterable < PointGroup > groups ( ) { return new Iterable < PointGroup > ( ) { public Iterator < PointGroup > iterator ( ) { return MapComposedElement . this . groupIterator ( ) ; } } ; } | Replies the iterator on the groups . |
6,079 | public Iterable < Point2d > points ( ) { return new Iterable < Point2d > ( ) { public Iterator < Point2d > iterator ( ) { return MapComposedElement . this . pointIterator ( ) ; } } ; } | Replies the iterator on the points . |
6,080 | public int addPoint ( double x , double y ) { int pointIndex ; if ( this . pointCoordinates == null ) { this . pointCoordinates = new double [ ] { x , y } ; this . partIndexes = null ; pointIndex = 0 ; } else { double [ ] pts = new double [ this . pointCoordinates . length + 2 ] ; System . arraycopy ( this . pointCoord... | Add the specified point at the end of the last group . |
6,081 | public int addGroup ( double x , double y ) { int pointIndex ; if ( this . pointCoordinates == null ) { this . pointCoordinates = new double [ ] { x , y } ; this . partIndexes = null ; pointIndex = 0 ; } else { double [ ] pts = new double [ this . pointCoordinates . length + 2 ] ; System . arraycopy ( this . pointCoord... | Add the specified point into a newgroup . |
6,082 | public MapComposedElement invertPointsIn ( int groupIndex ) { if ( this . pointCoordinates == null ) { throw new IndexOutOfBoundsException ( ) ; } final int grpCount = getGroupCount ( ) ; if ( groupIndex < 0 ) { throw new IndexOutOfBoundsException ( groupIndex + "<0" ) ; } if ( groupIndex > grpCount ) { throw new Index... | invert the points coordinates of this element on the groupIndex in argument . |
6,083 | public MapComposedElement invert ( ) { if ( this . pointCoordinates == null ) { throw new IndexOutOfBoundsException ( ) ; } double [ ] tmp = new double [ this . pointCoordinates . length ] ; for ( int i = 0 ; i < this . pointCoordinates . length ; i += 2 ) { tmp [ i ] = this . pointCoordinates [ this . pointCoordinates... | Invert the order of points coordinates of this element and reorder the groupIndex too . |
6,084 | public Point2d getPointAt ( int index ) { final int count = getPointCount ( ) ; int idx = index ; if ( idx < 0 ) { idx = count + idx ; } if ( idx < 0 ) { throw new IndexOutOfBoundsException ( idx + "<0" ) ; } if ( idx >= count ) { throw new IndexOutOfBoundsException ( idx + ">=" + count ) ; } return new Point2d ( this ... | Replies the specified point at the given index . |
6,085 | public Point2d getPointAt ( int groupIndex , int indexInGroup ) { final int startIndex = firstInGroup ( groupIndex ) ; final int groupMemberCount = getPointCountInGroup ( groupIndex ) ; if ( indexInGroup < 0 ) { throw new IndexOutOfBoundsException ( indexInGroup + "<0" ) ; } if ( indexInGroup >= groupMemberCount ) { th... | Replies the specified point at the given index in the specified group . |
6,086 | public boolean removeGroupAt ( int groupIndex ) { try { final int startIndex = firstInGroup ( groupIndex ) ; final int lastIndex = lastInGroup ( groupIndex ) ; final int ptsToRemoveCount = ( lastIndex - startIndex + 2 ) / 2 ; int rest = this . pointCoordinates . length / 2 - ptsToRemoveCount ; if ( rest > 0 ) { rest *=... | Remove the specified group . |
6,087 | public Point2d removePointAt ( int groupIndex , int indexInGroup ) { final int startIndex = firstInGroup ( groupIndex ) ; final int lastIndex = lastInGroup ( groupIndex ) ; final int g = indexInGroup * 2 + startIndex ; if ( g < startIndex ) { throw new IndexOutOfBoundsException ( g + "<" + startIndex ) ; } if ( g > las... | Remove the specified point at the given index in the specified group . |
6,088 | private boolean canonize ( int index ) { final int count = getPointCount ( ) ; int ix = index ; if ( ix < 0 ) { ix = count + ix ; } if ( ix < 0 ) { throw new IndexOutOfBoundsException ( ix + "<0" ) ; } if ( ix >= count ) { throw new IndexOutOfBoundsException ( ix + ">=" + count ) ; } final int partIndex = groupIndexFor... | Remove unnecessary points from the specified index . |
6,089 | private Optional < IncludeAllPageWithOutput > addOutputInformation ( IncludeAllPage pages , FileResource baseResource , Path includeAllBasePath , Locale locale ) { if ( pages . depth == 0 ) { return of ( new IncludeAllPageWithOutput ( pages , pages . files . get ( 0 ) , pages . files . get ( 0 ) . getPath ( ) , locale ... | generate the final output path |
6,090 | public Reactor getReactorByIndex ( int index ) { if ( index < 0 || index > reactorSet . length - 1 ) { throw new ArrayIndexOutOfBoundsException ( ) ; } return reactorSet [ index ] ; } | Find reactor by index |
6,091 | @ SuppressWarnings ( "rawtypes" ) public static CompoundPainter getCompoundPainter ( final Color matte , final Color gloss , final GlossPainter . GlossPosition position , final double angle , final Color pinstripe ) { final MattePainter mp = new MattePainter ( matte ) ; final GlossPainter gp = new GlossPainter ( gloss ... | Gets a CompoundPainter object . |
6,092 | @ SuppressWarnings ( "rawtypes" ) public static CompoundPainter getCompoundPainter ( final Color color , final GlossPainter . GlossPosition position , final double angle ) { final MattePainter mp = new MattePainter ( color ) ; final GlossPainter gp = new GlossPainter ( color , position ) ; final PinstripePainter pp = n... | Gets the compound painter . |
6,093 | public static MattePainter getMattePainter ( final int width , final int height , final float [ ] fractions , final Color ... colors ) { final LinearGradientPaint gradientPaint = new LinearGradientPaint ( 0.0f , 0.0f , width , height , fractions , colors ) ; final MattePainter mattePainter = new MattePainter ( gradient... | Gets a MattePainter object . |
6,094 | public void set ( Point3D center , double radius1 ) { this . cx = center . getX ( ) ; this . cy = center . getY ( ) ; this . cz = center . getZ ( ) ; this . radius = Math . abs ( radius1 ) ; } | Change the frame of te sphere . |
6,095 | public ListProperty < T > elementsProperty ( ) { if ( this . elements == null ) { this . elements = new SimpleListProperty < > ( this , MathFXAttributeNames . ELEMENTS , new InternalObservableList < > ( ) ) ; } return this . elements ; } | Replies the property that contains all the shapes in this multishape . |
6,096 | @ SuppressWarnings ( "unchecked" ) protected static < E > Class < ? extends E > extractClassFrom ( Collection < ? extends E > collection ) { Class < ? extends E > clazz = null ; for ( final E elt : collection ) { clazz = ( Class < ? extends E > ) ReflectionUtil . getCommonType ( clazz , elt . getClass ( ) ) ; } return ... | Extract the upper class that contains all the elements of this array . |
6,097 | public HelpSet getHelpSet ( ) { HelpSet hs = null ; final String filename = "simple-hs.xml" ; final String path = "help/" + filename ; URL hsURL ; hsURL = ClassExtensions . getResource ( path ) ; try { if ( hsURL != null ) { hs = new HelpSet ( ClassExtensions . getClassLoader ( ) , hsURL ) ; } else { hs = new HelpSet (... | Gets the help set . |
6,098 | protected JMenu newHelpMenu ( final ActionListener listener ) { final JMenu menuHelp = new JMenu ( newLabelTextHelp ( ) ) ; menuHelp . setMnemonic ( 'H' ) ; final JMenuItem mihHelpContent = JComponentFactory . newJMenuItem ( newLabelTextContent ( ) , 'c' , 'H' ) ; menuHelp . add ( mihHelpContent ) ; CSH . setHelpIDStri... | Creates the help menu . |
6,099 | protected JMenu newLookAndFeelMenu ( final ActionListener listener ) { final JMenu menuLookAndFeel = new JMenu ( "Look and Feel" ) ; menuLookAndFeel . setMnemonic ( 'L' ) ; JMenuItem jmiPlafGTK ; jmiPlafGTK = new JMenuItem ( "GTK" , 'g' ) ; MenuExtensions . setCtrlAccelerator ( jmiPlafGTK , 'G' ) ; jmiPlafGTK . addActi... | Creates the look and feel menu . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.