idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
5,800
protected final void openSessionForRead ( String applicationId , List < String > permissions , SessionLoginBehavior behavior , int activityCode ) { openSession ( applicationId , permissions , behavior , activityCode , SessionAuthorizationType . READ ) ; }
Opens a new session with read permissions . If either applicationID or permissions is null this method will default to using the values from the associated meta - data value and an empty list respectively .
5,801
public static void fetchDeferredAppLinkData ( Context context , String applicationId , final CompletionHandler completionHandler ) { Validate . notNull ( context , "context" ) ; Validate . notNull ( completionHandler , "completionHandler" ) ; if ( applicationId == null ) { applicationId = Utility . getMetadataApplicati...
Asynchronously fetches app link information that might have been stored for use after installation of the app
5,802
public static AppLinkData createFromActivity ( Activity activity ) { Validate . notNull ( activity , "activity" ) ; Intent intent = activity . getIntent ( ) ; if ( intent == null ) { return null ; } AppLinkData appLinkData = createFromAlApplinkData ( intent ) ; if ( appLinkData == null ) { String appLinkArgsJsonString ...
Parses out any app link data from the Intent of the Activity passed in .
5,803
public void setPattern ( Pattern regex ) { this . re = regex ; int memregCount , counterCount , lookaheadCount ; if ( ( memregCount = regex . memregs ) > 0 ) { MemReg [ ] memregs = new MemReg [ memregCount ] ; for ( int i = 0 ; i < memregCount ; i ++ ) { memregs [ i ] = new MemReg ( - 1 ) ; } this . memregs = memregs ;...
Sets the regex Pattern this tries to match . Won t do anything until the target is set as well .
5,804
public void skip ( ) { int we = wEnd ; if ( wOffset == we ) { if ( top == null ) { wOffset ++ ; flush ( ) ; } return ; } else { if ( we < 0 ) wOffset = 0 ; else wOffset = we ; } flush ( ) ; }
Sets the current search position just after the end of last match .
5,805
public void flush ( ) { top = null ; defaultEntry . reset ( 0 ) ; first . reset ( minQueueLength ) ; for ( int i = memregs . length - 1 ; i > 0 ; i -- ) { MemReg mr = memregs [ i ] ; mr . in = mr . out = - 1 ; } called = false ; }
Resets the internal state .
5,806
public int start ( String name ) { Integer id = re . groupId ( name ) ; if ( id == null ) throw new IllegalArgumentException ( "<" + name + "> isn't defined" ) ; return start ( id ) ; }
Returns the start index of the subsequence captured by the given named - capturing group during the previous match operation .
5,807
private static int repeat ( char [ ] data , int off , int out , Term term ) { switch ( term . type ) { case Term . CHAR : { char c = term . c ; int i = off ; while ( i < out ) { if ( data [ i ] != c ) break ; i ++ ; } return i - off ; } case Term . ANY_CHAR : { return out - off ; } case Term . ANY_CHAR_NE : { int i = o...
repeat while matches
5,808
private static int find ( char [ ] data , int off , int out , Term term ) { if ( off >= out ) return - 1 ; switch ( term . type ) { case Term . CHAR : { char c = term . c ; int i = off ; while ( i < out ) { if ( data [ i ] == c ) break ; i ++ ; } return i - off ; } case Term . BITSET : { IntBitSet arr = term . bitset ;...
repeat while doesn t match
5,809
public PendingCall present ( ) { logDialogActivity ( activity , fragment , getEventName ( appCall . getRequestIntent ( ) ) , AnalyticsEvents . PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED ) ; if ( onPresentCallback != null ) { try { onPresentCallback . onPresent ( activity ) ; } catch ( Exception e ) { throw new FacebookEx...
Launches an activity in the Facebook application to present the desired dialog . This method returns a PendingCall that contains a unique ID associated with this call to the Facebook application . In general a calling Activity should use UiLifecycleHelper to handle incoming activity results in order to ensure proper pr...
5,810
public static boolean handleActivityResult ( Context context , PendingCall appCall , int requestCode , Intent data , Callback callback ) { if ( requestCode != appCall . getRequestCode ( ) ) { return false ; } if ( attachmentStore != null ) { attachmentStore . cleanupAttachmentsForCall ( context , appCall . getCallId ( ...
Parses the results of a dialog activity and calls the appropriate method on the provided Callback .
5,811
public static boolean canPresentShareDialog ( Context context , ShareDialogFeature ... features ) { return handleCanPresent ( context , EnumSet . of ( ShareDialogFeature . SHARE_DIALOG , features ) ) ; }
Determines whether the version of the Facebook application installed on the user s device is recent enough to support specific features of the native Share dialog which in turn may be used to determine which UI etc . to present to the user .
5,812
public static boolean canPresentMessageDialog ( Context context , MessageDialogFeature ... features ) { return handleCanPresent ( context , EnumSet . of ( MessageDialogFeature . MESSAGE_DIALOG , features ) ) ; }
Determines whether the version of the Facebook application installed on the user s device is recent enough to support specific features of the native Message dialog which in turn may be used to determine which UI etc . to present to the user .
5,813
public static boolean canPresentOpenGraphActionDialog ( Context context , OpenGraphActionDialogFeature ... features ) { return handleCanPresent ( context , EnumSet . of ( OpenGraphActionDialogFeature . OG_ACTION_DIALOG , features ) ) ; }
Determines whether the version of the Facebook application installed on the user s device is recent enough to support specific features of the native Open Graph action dialog which in turn may be used to determine which UI etc . to present to the user .
5,814
public static boolean canPresentOpenGraphMessageDialog ( Context context , OpenGraphMessageDialogFeature ... features ) { return handleCanPresent ( context , EnumSet . of ( OpenGraphMessageDialogFeature . OG_MESSAGE_DIALOG , features ) ) ; }
Determines whether the version of the Facebook application installed on the user s device is recent enough to support specific features of the native Open Graph Message dialog which in turn may be used to determine which UI etc . to present to the user .
5,815
private static String reduceVariant ( final String variant ) { if ( isEmpty ( variant ) ) throw new AssertionError ( "Shouldn't happen, can't reduce non existent variant" ) ; int indexOfUnderscore = variant . lastIndexOf ( '_' ) ; if ( indexOfUnderscore == - 1 ) return "" ; return variant . substring ( 0 , indexOfUnder...
This function is used internally to reduce the variant - > a_b_c - > a_b .
5,816
@ SuppressWarnings ( { "unchecked" } ) public static < V > V associate ( Associator associator , Serializable id , V value ) { associator . setAssociated ( new TypedIdKey < V > ( ( Class < V > ) value . getClass ( ) , id ) , value ) ; return value ; }
Associates the given value s type and the id with the given value using the given associator .
5,817
@ SuppressWarnings ( { "unchecked" } ) public static < V > V put ( Map < ? super TypedIdKey < V > , ? super V > map , Serializable id , V value ) { map . put ( new TypedIdKey < V > ( ( Class < V > ) value . getClass ( ) , id ) , value ) ; return value ; }
Associates the given value s type and the id with the given value using the given map .
5,818
public static < V > Optional < V > associated ( Associator associator , Class < V > type , Serializable id ) { return associator . associated ( new TypedIdKey < > ( type , id ) , type ) ; }
Retrieves a value with the given type and id from the given associator .
5,819
@ SuppressWarnings ( { "unchecked" } ) public static < V > Optional < V > get ( Map < ? , ? > map , Class < V > type , Serializable id ) { return Optional . ofNullable ( ( V ) map . get ( new TypedIdKey < > ( type , id ) ) ) ; }
Retrieves a value with the given type and id from the given map .
5,820
public static BaseFolder with ( String first , String ... more ) { return new BaseFolder ( Paths . get ( first , more ) ) ; }
Creates a new base folder at the specified location .
5,821
@ SuppressWarnings ( { "PMD.GuardLogStatement" , "PMD.AvoidDuplicateLiterals" } ) public void add ( Object obj ) { synchronized ( this ) { running += 1 ; if ( generators != null ) { generators . put ( obj , null ) ; generatorTracking . finest ( ( ) -> "Added generator " + obj + ", " + generators . size ( ) + " generato...
Adds a generator .
5,822
@ SuppressWarnings ( "PMD.GuardLogStatement" ) public void remove ( Object obj ) { synchronized ( this ) { running -= 1 ; if ( generators != null ) { generators . remove ( obj ) ; generatorTracking . finest ( ( ) -> "Removed generator " + obj + ", " + generators . size ( ) + " generators registered: " + generators . ke...
Removes the generator .
5,823
@ SuppressWarnings ( { "PMD.CollapsibleIfStatements" , "PMD.GuardLogStatement" } ) public void awaitExhaustion ( ) throws InterruptedException { synchronized ( this ) { if ( generators != null ) { if ( running != generators . size ( ) ) { generatorTracking . severe ( ( ) -> "Generator count doesn't match tracked." ) ; ...
Await exhaustion .
5,824
@ SuppressWarnings ( { "PMD.CollapsibleIfStatements" , "PMD.GuardLogStatement" } ) public boolean awaitExhaustion ( long timeout ) throws InterruptedException { synchronized ( this ) { if ( generators != null ) { if ( running != generators . size ( ) ) { generatorTracking . severe ( "Generator count doesn't match track...
Await exhaustion with a timeout .
5,825
public boolean matchesLocale ( String loc ) { return getLocale ( ) == null || ( getLocale ( ) . isPresent ( ) && getLocale ( ) . get ( ) . startsWith ( loc ) ) ; }
Returns true if the information matches the specified locale .
5,826
public static Request newPostRequest ( Session session , String graphPath , GraphObject graphObject , Callback callback ) { Request request = new Request ( session , graphPath , null , HttpMethod . POST , callback ) ; request . setGraphObject ( graphObject ) ; return request ; }
Creates a new Request configured to post a GraphObject to a particular graph path to either create or update the object at that path .
5,827
public static Request newMeRequest ( Session session , final GraphUserCallback callback ) { Callback wrapper = new Callback ( ) { public void onCompleted ( Response response ) { if ( callback != null ) { callback . onCompleted ( response . getGraphObjectAs ( GraphUser . class ) , response ) ; } } } ; return new Request...
Creates a new Request configured to retrieve a user s own profile .
5,828
public static Request newMyFriendsRequest ( Session session , final GraphUserListCallback callback ) { Callback wrapper = new Callback ( ) { public void onCompleted ( Response response ) { if ( callback != null ) { callback . onCompleted ( typedListFromResponse ( response , GraphUser . class ) , response ) ; } } } ; re...
Creates a new Request configured to retrieve a user s friend list .
5,829
public static Request newUploadPhotoRequest ( Session session , Bitmap image , Callback callback ) { Bundle parameters = new Bundle ( 1 ) ; parameters . putParcelable ( PICTURE_PARAM , image ) ; return new Request ( session , MY_PHOTOS , parameters , HttpMethod . POST , callback ) ; }
Creates a new Request configured to upload a photo to the user s default photo album .
5,830
public static Request newUploadPhotoRequest ( Session session , File file , Callback callback ) throws FileNotFoundException { ParcelFileDescriptor descriptor = ParcelFileDescriptor . open ( file , ParcelFileDescriptor . MODE_READ_ONLY ) ; Bundle parameters = new Bundle ( 1 ) ; parameters . putParcelable ( PICTURE_PARA...
Creates a new Request configured to upload a photo to the user s default photo album . The photo will be read from the specified stream .
5,831
public static Request newUploadVideoRequest ( Session session , File file , Callback callback ) throws FileNotFoundException { ParcelFileDescriptor descriptor = ParcelFileDescriptor . open ( file , ParcelFileDescriptor . MODE_READ_ONLY ) ; Bundle parameters = new Bundle ( 1 ) ; parameters . putParcelable ( file . getNa...
Creates a new Request configured to upload a photo to the user s default photo album . The photo will be read from the specified file descriptor .
5,832
public static Request newGraphPathRequest ( Session session , String graphPath , Callback callback ) { return new Request ( session , graphPath , null , null , callback ) ; }
Creates a new Request configured to retrieve a particular graph path .
5,833
public static Request newPlacesSearchRequest ( Session session , Location location , int radiusInMeters , int resultsLimit , String searchText , final GraphPlaceListCallback callback ) { if ( location == null && Utility . isNullOrEmpty ( searchText ) ) { throw new FacebookException ( "Either location or searchText must...
Creates a new Request that is configured to perform a search for places near a specified location via the Graph API . At least one of location or searchText must be specified .
5,834
public static Request newPostOpenGraphActionRequest ( Session session , OpenGraphAction openGraphAction , Callback callback ) { if ( openGraphAction == null ) { throw new FacebookException ( "openGraphAction cannot be null" ) ; } if ( Utility . isNullOrEmpty ( openGraphAction . getType ( ) ) ) { throw new FacebookExcep...
Creates a new Request configured to publish an Open Graph action .
5,835
public static Request newDeleteObjectRequest ( Session session , String id , Callback callback ) { return new Request ( session , id , null , HttpMethod . DELETE , callback ) ; }
Creates a new Request configured to delete a resource through the Graph API .
5,836
public static final ConfigurationSourceKey propertyFile ( final String name ) { return new ConfigurationSourceKey ( Type . FILE , Format . PROPERTIES , name ) ; }
Creates a new configuration source key for property files .
5,837
public static final ConfigurationSourceKey xmlFile ( final String name ) { return new ConfigurationSourceKey ( Type . FILE , Format . XML , name ) ; }
Creates a new configuration source key for xml files .
5,838
public static final ConfigurationSourceKey jsonFile ( final String name ) { return new ConfigurationSourceKey ( Type . FILE , Format . JSON , name ) ; }
Creates a new configuration source key for json files .
5,839
public static < T > boolean isSubset ( Collection < T > subset , Collection < T > superset ) { if ( ( superset == null ) || ( superset . size ( ) == 0 ) ) { return ( ( subset == null ) || ( subset . size ( ) == 0 ) ) ; } HashSet < T > hash = new HashSet < T > ( superset ) ; for ( T t : subset ) { if ( ! hash . contains...
the same .
5,840
static InputStream getCachedImageStream ( URI url , Context context ) { InputStream imageStream = null ; if ( url != null ) { if ( isCDNURL ( url ) ) { try { FileLruCache cache = getCache ( context ) ; imageStream = cache . get ( url . toString ( ) ) ; } catch ( IOException e ) { Logger . log ( LoggingBehavior . CACHE ...
Does not throw if there was an error .
5,841
public void reduceThis ( ) { if ( elements == null || elements . isEmpty ( ) ) throw new AssertionError ( "Can't reduce this environment" ) ; elements . remove ( elements . size ( ) - 1 ) ; }
Reduces current environment . Modifies current object hence NOT THREADSAFE .
5,842
public static Environment parse ( final String s ) { if ( s == null || s . isEmpty ( ) || s . trim ( ) . isEmpty ( ) ) return GlobalEnvironment . INSTANCE ; final String [ ] tokens = StringUtils . tokenize ( s , '_' ) ; final DynamicEnvironment env = new DynamicEnvironment ( ) ; for ( final String t : tokens ) { env . ...
Parses a string and creates a new Environment which corresponds the string .
5,843
public static void downloadAsync ( ImageRequest request ) { if ( request == null ) { return ; } RequestKey key = new RequestKey ( request . getImageUri ( ) , request . getCallerTag ( ) ) ; synchronized ( pendingRequests ) { DownloaderContext downloaderContext = pendingRequests . get ( key ) ; if ( downloaderContext != ...
Downloads the image specified in the passed in request . If a callback is specified it is guaranteed to be invoked on the calling thread .
5,844
public static AppEventsLogger newLogger ( Context context , String applicationId ) { return new AppEventsLogger ( context , applicationId , null ) ; }
Build an AppEventsLogger instance to log events that are attributed to the application but not to any particular Session .
5,845
public void logEvent ( String eventName , Bundle parameters ) { logEvent ( eventName , null , parameters , false ) ; }
Log an app event with the specified name and set of parameters .
5,846
public void logEvent ( String eventName , double valueToSum , Bundle parameters ) { logEvent ( eventName , valueToSum , parameters , false ) ; }
Log an app event with the specified name supplied value and set of parameters .
5,847
public void logPurchase ( BigDecimal purchaseAmount , Currency currency , Bundle parameters ) { if ( purchaseAmount == null ) { notifyDeveloperError ( "purchaseAmount cannot be null" ) ; return ; } else if ( currency == null ) { notifyDeveloperError ( "currency cannot be null" ) ; return ; } if ( parameters == null ) {...
Logs a purchase event with Facebook in the specified amount and with the specified currency . Additional detail about the purchase can be passed in through the parameters bundle .
5,848
public void logSdkEvent ( String eventName , Double valueToSum , Bundle parameters ) { logEvent ( eventName , valueToSum , parameters , true ) ; }
This method is intended only for internal use by the Facebook SDK and other use is unsupported .
5,849
private static SessionEventsState getSessionEventsState ( Context context , AccessTokenAppIdPair accessTokenAppId ) { SessionEventsState state = stateMap . get ( accessTokenAppId ) ; AttributionIdentifiers attributionIdentifiers = null ; if ( state == null ) { attributionIdentifiers = AttributionIdentifiers . getAttrib...
Creates a new SessionEventsState if not already in the map .
5,850
private static void setSourceApplication ( Activity activity ) { ComponentName callingApplication = activity . getCallingActivity ( ) ; if ( callingApplication != null ) { String callingApplicationPackage = callingApplication . getPackageName ( ) ; if ( callingApplicationPackage . equals ( activity . getPackageName ( )...
Source Application setters and getters
5,851
private Pair < List < BooleanExpression > , Optional < BooleanExpression > > extractWhereConditions ( SelectQueryAware selectQueryAware ) { List < BooleanExpression > whereConditions = new ArrayList < > ( ) ; Optional < BooleanExpression > whereExpressionCandidate = selectQueryAware . getWhereExpression ( ) ; if ( wher...
Deciding whether having clause can be moved to where clause
5,852
private Pair < DataSource , Optional < BooleanExpression > > optimizeDataSource ( DataSource originalDataSource , List < BooleanExpression > originalWhereConditions , Map < String , Object > selectionMap , Map < String , String > tableAliases ) { OptimizationContext optimizationContext = analyzeOriginalData ( originalD...
Deciding whether parts of where clause can be moved to data sources
5,853
public static ReplyObject success ( final String name , final Object result ) { final ReplyObject ret = new ReplyObject ( name , result ) ; ret . success = true ; return ret ; }
Factory method that creates a new reply object for successful request .
5,854
public final void close ( ) { synchronized ( this . lock ) { final SessionState oldState = this . state ; switch ( this . state ) { case CREATED : case OPENING : this . state = SessionState . CLOSED_LOGIN_FAILED ; postStateChange ( oldState , this . state , new FacebookException ( "Log in attempt aborted." ) ) ; break ...
Closes the local in - memory Session object but does not clear the persisted token cache .
5,855
public final void closeAndClearTokenInformation ( ) { if ( this . tokenCachingStrategy != null ) { this . tokenCachingStrategy . clear ( ) ; } Utility . clearFacebookCookies ( staticContext ) ; Utility . clearCaches ( staticContext ) ; close ( ) ; }
Closes the local in - memory Session object and clears any persisted token cache related to the Session .
5,856
public final void addCallback ( StatusCallback callback ) { synchronized ( callbacks ) { if ( callback != null && ! callbacks . contains ( callback ) ) { callbacks . add ( callback ) ; } } }
Adds a callback that will be called when the state of this Session changes .
5,857
public static final void saveSession ( Session session , Bundle bundle ) { if ( bundle != null && session != null && ! bundle . containsKey ( SESSION_BUNDLE_SAVE_KEY ) ) { ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ; try { new ObjectOutputStream ( outputStream ) . writeObject ( session ) ; } cat...
Save the Session object into the supplied Bundle . This method is intended to be called from an Activity or Fragment s onSaveInstanceState method in order to preserve Sessions across Activity lifecycle events .
5,858
public static final Session restoreSession ( Context context , TokenCachingStrategy cachingStrategy , StatusCallback callback , Bundle bundle ) { if ( bundle == null ) { return null ; } byte [ ] data = bundle . getByteArray ( SESSION_BUNDLE_SAVE_KEY ) ; if ( data != null ) { ByteArrayInputStream is = new ByteArrayInput...
Restores the saved session from a Bundle if any . Returns the restored Session or null if it could not be restored . This method is intended to be called from an Activity or Fragment s onCreate method when a Session has previously been saved into a Bundle via saveState to preserve a Session across Activity lifecycle ev...
5,859
public Node getConfigurationOption ( String optionName ) { NodeList children = configuration . getChildNodes ( ) ; Node configurationOption = null ; for ( int childIndex = 0 ; childIndex < children . getLength ( ) ; childIndex ++ ) { if ( children . item ( childIndex ) . getNodeName ( ) . equals ( optionName ) ) { conf...
Get a configuration option of this configurator .
5,860
public String getConfigurationOptionValue ( String optionName , String defaultValue ) { String optionValue ; Node configurationOption = this . getConfigurationOption ( optionName ) ; if ( configurationOption != null ) { optionValue = configurationOption . getTextContent ( ) ; } else { optionValue = defaultValue ; } ret...
Get a configuration option value as String .
5,861
public InputStream interceptAndPut ( String key , InputStream input ) throws IOException { OutputStream output = openPutStream ( key ) ; return new CopyingInputStream ( input , output ) ; }
copy of input and associate that data with key .
5,862
public void configure ( ) { ServletContext servletContext = ServletActionContext . getServletContext ( ) ; ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver ( servletContext ) ; templateResolver . setTemplateMode ( templateMode ) ; templateResolver . setCharacterEncoding ( characterEn...
Configure settings from the struts . xml or struts . properties using sensible defaults if values are not provided .
5,863
public void setContainer ( Container container ) { this . container = container ; Map < String , TemplateEngine > map = new HashMap < String , TemplateEngine > ( ) ; Set < String > prefixes = container . getInstanceNames ( TemplateEngine . class ) ; for ( String prefix : prefixes ) { TemplateEngine engine = ( TemplateE...
loading di container configulation from struts - plugin . xml choise thymeleaf template engine .
5,864
public static boolean hasTokenInformation ( Bundle bundle ) { if ( bundle == null ) { return false ; } String token = bundle . getString ( TOKEN_KEY ) ; if ( ( token == null ) || ( token . length ( ) == 0 ) ) { return false ; } long expiresMilliseconds = bundle . getLong ( EXPIRATION_DATE_KEY , 0L ) ; if ( expiresMilli...
Returns a boolean indicating whether a Bundle contains properties that could be a valid saved token .
5,865
public static String getToken ( Bundle bundle ) { Validate . notNull ( bundle , "bundle" ) ; return bundle . getString ( TOKEN_KEY ) ; }
Gets the cached token value from a Bundle .
5,866
public static void putToken ( Bundle bundle , String value ) { Validate . notNull ( bundle , "bundle" ) ; Validate . notNull ( value , "value" ) ; bundle . putString ( TOKEN_KEY , value ) ; }
Puts the token value into a Bundle .
5,867
public static Date getExpirationDate ( Bundle bundle ) { Validate . notNull ( bundle , "bundle" ) ; return getDate ( bundle , EXPIRATION_DATE_KEY ) ; }
Gets the cached expiration date from a Bundle .
5,868
public static List < String > getPermissions ( Bundle bundle ) { Validate . notNull ( bundle , "bundle" ) ; return bundle . getStringArrayList ( PERMISSIONS_KEY ) ; }
Gets the cached list of permissions from a Bundle .
5,869
public static void putPermissions ( Bundle bundle , List < String > value ) { Validate . notNull ( bundle , "bundle" ) ; Validate . notNull ( value , "value" ) ; ArrayList < String > arrayList ; if ( value instanceof ArrayList < ? > ) { arrayList = ( ArrayList < String > ) value ; } else { arrayList = new ArrayList < S...
Puts the list of permissions into a Bundle .
5,870
public static void putDeclinedPermissions ( Bundle bundle , List < String > value ) { Validate . notNull ( bundle , "bundle" ) ; Validate . notNull ( value , "value" ) ; ArrayList < String > arrayList ; if ( value instanceof ArrayList < ? > ) { arrayList = ( ArrayList < String > ) value ; } else { arrayList = new Array...
Puts the list of declined permissions into a Bundle .
5,871
public static AccessTokenSource getSource ( Bundle bundle ) { Validate . notNull ( bundle , "bundle" ) ; if ( bundle . containsKey ( TokenCachingStrategy . TOKEN_SOURCE_KEY ) ) { return ( AccessTokenSource ) bundle . getSerializable ( TokenCachingStrategy . TOKEN_SOURCE_KEY ) ; } else { boolean isSSO = bundle . getBool...
Gets the cached enum indicating the source of the token from the Bundle .
5,872
public static void putSource ( Bundle bundle , AccessTokenSource value ) { Validate . notNull ( bundle , "bundle" ) ; bundle . putSerializable ( TOKEN_SOURCE_KEY , value ) ; }
Puts the enum indicating the source of the token into a Bundle .
5,873
public static Date getLastRefreshDate ( Bundle bundle ) { Validate . notNull ( bundle , "bundle" ) ; return getDate ( bundle , LAST_REFRESH_DATE_KEY ) ; }
Gets the cached last refresh date from a Bundle .
5,874
public Builder newCopyBuilder ( ) { return new Builder ( getInputFormat ( ) , getOutputFormat ( ) , getActivity ( ) ) . locale ( getLocale ( ) ) . setRequiredOptions ( keys ) ; }
Creates a new builder with the same settings as this information .
5,875
public static Builder newConvertBuilder ( String input , String output ) { return new Builder ( input , output , TaskGroupActivity . CONVERT ) ; }
Creates a new builder of convert type with the specified parameters .
5,876
@ SuppressWarnings ( { "PMD.DataflowAnomalyAnalysis" , "PMD.AvoidCatchingGenericException" , "PMD.UseStringBufferForStringAppends" , "PMD.SystemPrintln" } ) public void printError ( Error event ) { String msg = "Unhandled " + event ; System . err . println ( msg ) ; if ( event . throwable ( ) == null ) { System . err ....
Prints the error .
5,877
protected List < Segment > segment ( ) { List < Segment > segments = new ArrayList < > ( ) ; List < Recipe > recipeStack = new ArrayList < > ( ) ; recipeStack . add ( this ) ; _segment ( new Recipe ( ) , recipeStack , null , segments ) ; return segments ; }
original recipe but more efficient for sending payloads of ingredients to different services .
5,878
@ RequestHandler ( patterns = "/ws/echo" , priority = 100 ) public void onGet ( Request . In . Get event , IOSubchannel channel ) throws InterruptedException { final HttpRequest request = event . httpRequest ( ) ; if ( ! request . findField ( HttpField . UPGRADE , Converters . STRING_LIST ) . map ( f -> f . value ( ) ....
Handle GET requests .
5,879
public void onUpgraded ( Upgraded event , IOSubchannel channel ) { if ( ! openChannels . contains ( channel ) ) { return ; } channel . respond ( Output . from ( "/Greetings!" , true ) ) ; }
Handle upgrade confirmation .
5,880
public void onOutput ( Output < ByteBuffer > event , PlainChannel plainChannel ) throws InterruptedException , SSLException , ExecutionException { if ( plainChannel . hub ( ) != this ) { return ; } plainChannel . sendUpstream ( event ) ; }
Sends decrypted data through the engine and then upstream .
5,881
public void onClose ( Close event , PlainChannel plainChannel ) throws InterruptedException , SSLException { if ( plainChannel . hub ( ) != this ) { return ; } plainChannel . close ( event ) ; }
Forwards a close event upstream .
5,882
public void onInput ( Input < ByteBuffer > event , Channel channel ) { Writer writer = inputWriters . get ( channel ) ; if ( writer != null ) { writer . write ( event . buffer ( ) ) ; } }
Handle input by writing it to the file if a channel exists .
5,883
public void onClose ( Close event , Channel channel ) throws InterruptedException { Writer writer = inputWriters . get ( channel ) ; if ( writer != null ) { writer . close ( event ) ; } writer = outputWriters . get ( channel ) ; if ( writer != null ) { writer . close ( event ) ; } }
Handle close by closing the file associated with the channel .
5,884
@ Handler ( priority = - 1000 ) public void onStop ( Stop event ) throws InterruptedException { while ( ! inputWriters . isEmpty ( ) ) { Writer handler = inputWriters . entrySet ( ) . iterator ( ) . next ( ) . getValue ( ) ; handler . close ( event ) ; } while ( ! outputWriters . isEmpty ( ) ) { Writer handler = output...
Handle stop by closing all files .
5,885
private String data ( ) { if ( datasets . isEmpty ( ) ) { return "" ; } else { final StringBuilder ret = new StringBuilder ( ) ; int biggestSize = 0 ; for ( final Dataset dataset : datasets ) { biggestSize = Math . max ( biggestSize , dataset . numPoints ( ) ) ; } for ( int row = 0 ; row < biggestSize ; ++ row ) { ret ...
gnuplot annoyingly requires data to be written in columns
5,886
private String valueOrBlank ( Dataset dataset , int idx ) { if ( idx < dataset . numPoints ( ) ) { return Double . toString ( dataset . get ( idx ) ) ; } else { return "" ; } }
used by writeData
5,887
public static void main ( String [ ] argv ) throws IOException { final File outputDir = new File ( argv [ 0 ] ) ; final Random rand = new Random ( ) ; final double mean1 = 5.0 ; final double mean2 = 7.0 ; final double dev1 = 2.0 ; final double dev2 = 4.0 ; final double [ ] data1 = new double [ 100 ] ; final double [ ] ...
Little test program
5,888
public void setFirstAxis ( double x , double y , double z , double extent , CoordinateSystem3D system ) { this . axis1 . set ( x , y , z ) ; assert ( this . axis1 . isUnitVector ( ) ) ; if ( system . isLeftHanded ( ) ) { this . axis3 . set ( this . axis1 . crossLeftHand ( this . axis2 ) ) ; } else { this . axis3 . set ...
Set the first axis of the second . The third axis is updated to be perpendicular to the two other axis .
5,889
public ObjectProperty < PathWindingRule > windingRuleProperty ( ) { if ( this . windingRule == null ) { this . windingRule = new SimpleObjectProperty < > ( this , MathFXAttributeNames . WINDING_RULE , DEFAULT_WINDING_RULE ) ; } return this . windingRule ; }
Replies the windingRule property .
5,890
public BooleanProperty isPolylineProperty ( ) { if ( this . isPolyline == null ) { this . isPolyline = new ReadOnlyBooleanWrapper ( this , MathFXAttributeNames . IS_POLYLINE , false ) ; this . isPolyline . bind ( Bindings . createBooleanBinding ( ( ) -> { boolean first = true ; boolean hasOneLine = false ; for ( final ...
Replies the isPolyline property .
5,891
public BooleanProperty isCurvedProperty ( ) { if ( this . isCurved == null ) { this . isCurved = new ReadOnlyBooleanWrapper ( this , MathFXAttributeNames . IS_CURVED , false ) ; this . isCurved . bind ( Bindings . createBooleanBinding ( ( ) -> { for ( final PathElementType type : innerTypesProperty ( ) ) { if ( type ==...
Replies the isCurved property .
5,892
public BooleanProperty isPolygonProperty ( ) { if ( this . isPolygon == null ) { this . isPolygon = new ReadOnlyBooleanWrapper ( this , MathFXAttributeNames . IS_POLYGON , false ) ; this . isPolygon . bind ( Bindings . createBooleanBinding ( ( ) -> { boolean first = true ; boolean lastIsClose = false ; for ( final Path...
Replies the isPolygon property .
5,893
protected ReadOnlyListWrapper < PathElementType > innerTypesProperty ( ) { if ( this . types == null ) { this . types = new ReadOnlyListWrapper < > ( this , MathFXAttributeNames . TYPES , FXCollections . observableList ( new ArrayList < > ( ) ) ) ; } return this . types ; }
Replies the private types property .
5,894
protected void setMapLayerAt ( int index , L layer ) { this . subLayers . set ( index , layer ) ; layer . setContainer ( this ) ; resetBoundingBox ( ) ; }
Put the given layer at the given index but do not fire any event .
5,895
protected void fireLayerAddedEvent ( MapLayer layer , int index ) { fireLayerHierarchyChangedEvent ( new MapLayerHierarchyEvent ( this , layer , Type . ADD_CHILD , index , layer . isTemporaryLayer ( ) ) ) ; }
Fire the event that indicates a layer was added .
5,896
protected void fireLayerRemovedEvent ( MapLayer layer , int oldChildIndex ) { fireLayerHierarchyChangedEvent ( new MapLayerHierarchyEvent ( this , layer , Type . REMOVE_CHILD , oldChildIndex , layer . isTemporaryLayer ( ) ) ) ; }
Fire the event that indicates a layer was removed .
5,897
protected void fireLayerMovedUpEvent ( MapLayer layer , int newIndex ) { fireLayerHierarchyChangedEvent ( new MapLayerHierarchyEvent ( this , layer , Type . MOVE_CHILD_UP , newIndex , layer . isTemporaryLayer ( ) ) ) ; }
Fire the event that indicates a layer was moved up .
5,898
protected void fireLayerMovedDownEvent ( MapLayer layer , int newIndex ) { fireLayerHierarchyChangedEvent ( new MapLayerHierarchyEvent ( this , layer , Type . MOVE_CHILD_DOWN , newIndex , layer . isTemporaryLayer ( ) ) ) ; }
Fire the event that indicates a layer was moved down .
5,899
protected void fireLayerRemoveAllEvent ( List < ? extends L > removedObjects ) { fireLayerHierarchyChangedEvent ( new MapLayerHierarchyEvent ( this , removedObjects , Type . REMOVE_ALL_CHILDREN , - 1 , isTemporaryLayer ( ) ) ) ; }
Fire the event that indicates all the layers were removed .