idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
11,700
public void pullRemoteRevision ( final RevisionInternal rev ) { Log . d ( TAG , "%s: pullRemoteRevision with rev: %s" , this , rev ) ; ++ httpConnectionCount ; StringBuilder path = new StringBuilder ( encodeDocumentId ( rev . getDocID ( ) ) ) ; path . append ( "?rev=" ) . append ( URIUtils . encode ( rev . getRevID ( )...
Fetches the contents of a revision from the remote db including its parent revision ID . The contents are stored into rev . properties .
11,701
protected void queueRemoteRevision ( RevisionInternal rev ) { if ( rev . isDeleted ( ) ) { deletedRevsToPull . add ( rev ) ; } else { revsToPull . add ( rev ) ; } }
Add a revision to the appropriate queue of revs to individually GET
11,702
private static boolean isAllowed ( char c , String allow ) { return ( c >= 'A' && c <= 'Z' ) || ( c >= 'a' && c <= 'z' ) || ( c >= '0' && c <= '9' ) || "_-!.~'()*" . indexOf ( c ) != NOT_FOUND || ( allow != null && allow . indexOf ( c ) != NOT_FOUND ) ; }
Returns true if the given character is allowed .
11,703
public boolean mutateAttachments ( CollectionUtils . Functor < Map < String , Object > , Map < String , Object > > functor ) { { Map < String , Object > properties = getProperties ( ) ; Map < String , Object > editedProperties = null ; Map < String , Object > attachments = ( Map < String , Object > ) properties . get (...
Returns YES if any changes were made .
11,704
public void appendData ( byte [ ] data ) throws IOException , SymmetricKeyException { if ( data == null ) return ; appendData ( data , 0 , data . length ) ; }
Appends data to the blob . Call this when new data is available .
11,705
public void finish ( ) throws IOException , SymmetricKeyException { if ( outStream != null ) { if ( encryptor != null ) outStream . write ( encryptor . encrypt ( null ) ) ; outStream . close ( ) ; outStream = null ; blobKey = new BlobKey ( sha1Digest . digest ( ) ) ; md5DigestResult = md5Digest . digest ( ) ; } }
Call this after all the data has been added .
11,706
public void cancel ( ) { try { if ( outStream != null ) { outStream . close ( ) ; outStream = null ; } encryptor = null ; } catch ( IOException e ) { Log . w ( Log . TAG_BLOB_STORE , "Exception closing buffered output stream" , e ) ; } tempFile . delete ( ) ; }
Call this to cancel before finishing the data .
11,707
public boolean install ( ) { if ( tempFile == null ) return true ; String destPath = store . getRawPathForKey ( blobKey ) ; File destPathFile = new File ( destPath ) ; if ( tempFile . renameTo ( destPathFile ) ) tempFile = null ; else cancel ( ) ; return true ; }
Installs a finished blob into the store .
11,708
public QueryRow next ( ) { if ( nextRow >= rows . size ( ) ) { return null ; } return rows . get ( nextRow ++ ) ; }
Gets the next QueryRow from the results or null if there are no more results .
11,709
Map < String , Object > getProperties ( ) { Map < String , Object > props = new HashMap < String , Object > ( ) ; props . put ( "continuous" , isContinuous ( ) ) ; props . put ( "create_target" , shouldCreateTarget ( ) ) ; props . put ( "filter" , getFilter ( ) ) ; props . put ( "query_params" , getFilterParams ( ) ) ;...
Currently only used for test
11,710
public void start ( ) { if ( replicationInternal == null ) { initReplicationInternal ( ) ; } else { if ( replicationInternal . stateMachine . isInState ( ReplicationState . INITIAL ) ) { } else if ( replicationInternal . stateMachine . isInState ( ReplicationState . STOPPED ) ) { initReplicationInternal ( ) ; } else { ...
Starts the replication asynchronously .
11,711
public void setContinuous ( boolean isContinous ) { if ( isContinous ) { this . lifecycle = Lifecycle . CONTINUOUS ; replicationInternal . setLifecycle ( Lifecycle . CONTINUOUS ) ; } else { this . lifecycle = Lifecycle . ONESHOT ; replicationInternal . setLifecycle ( Lifecycle . ONESHOT ) ; } }
Set whether this replication is continous
11,712
public void setAuthenticator ( Authenticator authenticator ) { properties . put ( ReplicationField . AUTHENTICATOR , authenticator ) ; replicationInternal . setAuthenticator ( authenticator ) ; }
Set the Authenticator used for authenticating with the Sync Gateway
11,713
public void setCreateTarget ( boolean createTarget ) { properties . put ( ReplicationField . CREATE_TARGET , createTarget ) ; replicationInternal . setCreateTarget ( createTarget ) ; }
Set whether the target database be created if it doesn t already exist?
11,714
public void changed ( ChangeEvent event ) { final long lastSeqPushed = ( isPull ( ) || replicationInternal . lastSequence == null ) ? - 1L : Long . valueOf ( replicationInternal . lastSequence ) ; if ( lastSeqPushed >= 0 && lastSeqPushed != _lastSequencePushed ) { db . runAsync ( new AsyncTask ( ) { public void run ( D...
This is called back for changes from the ReplicationInternal . Simply propagate the events back to all listeners .
11,715
public void setFilter ( String filterName ) { properties . put ( ReplicationField . FILTER_NAME , filterName ) ; replicationInternal . setFilter ( filterName ) ; }
Set the filter to be used by this replication
11,716
public void setDocIds ( List < String > docIds ) { properties . put ( ReplicationField . DOC_IDS , docIds ) ; replicationInternal . setDocIds ( docIds ) ; }
Sets the documents to specify as part of the replication .
11,717
public void setFilterParams ( Map < String , Object > filterParams ) { properties . put ( ReplicationField . FILTER_PARAMS , filterParams ) ; replicationInternal . setFilterParams ( filterParams ) ; }
Set parameters to pass to the filter function .
11,718
public void setChannels ( List < String > channels ) { properties . put ( ReplicationField . CHANNELS , channels ) ; replicationInternal . setChannels ( channels ) ; }
Set the list of Sync Gateway channel names
11,719
private void initWithKey ( byte [ ] key ) throws SymmetricKeyException { if ( key == null ) throw new SymmetricKeyException ( "Key cannot be null" ) ; if ( key . length != KEY_SIZE ) throw new SymmetricKeyException ( "Key size is not " + KEY_SIZE + "bytes" ) ; keyData = key ; }
Initialize the object with a raw key of 32 bytes size .
11,720
public byte [ ] encryptData ( byte [ ] data ) throws SymmetricKeyException { Encryptor encryptor = createEncryptor ( ) ; byte [ ] encrypted = encryptor . encrypt ( data ) ; byte [ ] trailer = encryptor . encrypt ( null ) ; if ( encrypted == null || trailer == null ) throw new SymmetricKeyException ( "Cannot encrypt dat...
Encrypt the byte array data
11,721
private static byte [ ] generateKey ( int size ) throws SymmetricKeyException { if ( size <= 0 ) throw new IllegalArgumentException ( "Size cannot be zero or less than zero." ) ; try { SecureRandom secureRandom = new SecureRandom ( ) ; KeyGenerator keyGenerator = KeyGenerator . getInstance ( "AES" ) ; keyGenerator . in...
Generate an AES key of the specifies size in bytes .
11,722
private static byte [ ] secureRandom ( int size ) { if ( size <= 0 ) throw new IllegalArgumentException ( "Size cannot be zero or less than zero." ) ; SecureRandom secureRandom = new SecureRandom ( ) ; byte [ ] bytes = new byte [ size ] ; secureRandom . nextBytes ( bytes ) ; return bytes ; }
Secure random bytes of size in bytes
11,723
private Cipher getCipher ( int mode , byte [ ] iv ) throws SymmetricKeyException { Cipher cipher = null ; try { cipher = getCipherInstance ( "AES/CBC/PKCS7Padding" ) ; if ( cipher == null ) { throw new SymmetricKeyException ( "Cannot get a cipher instance for AES/CBC/PKCS7Padding algorithm" ) ; } SecretKey secret = new...
Get a cipher instance for either encrypt or decrypt mode with an IV header .
11,724
private Cipher getCipherInstance ( String algorithm ) { Cipher cipher = null ; if ( ! useBCProvider ) { try { cipher = Cipher . getInstance ( algorithm ) ; } catch ( NoSuchAlgorithmException e ) { Log . v ( Log . TAG_SYMMETRIC_KEY , "Cannot find a cipher (no algorithm); will try with Bouncy Castle provider." ) ; } catc...
Get a cipher instance for the algorithm . It will try to use the Cipher from the default security provider by the platform . If it couldn t find the cipher it will try to the cipher from the Bouncy Castle if the BouncyCastle library is available .
11,725
public synchronized long addValue ( String value ) { sequences . add ( ++ lastSequence ) ; values . add ( value ) ; return lastSequence ; }
Adds a value to the map assigning it a sequence number and returning it . Sequence numbers start at 1 and increment from there .
11,726
public synchronized long getCheckpointedSequence ( ) { long sequence = lastSequence ; if ( ! sequences . isEmpty ( ) ) { sequence = sequences . first ( ) - 1 ; } if ( sequence > firstValueSequence ) { int numToRemove = ( int ) ( sequence - firstValueSequence ) ; for ( int i = 0 ; i < numToRemove ; i ++ ) { values . rem...
Returns the maximum consecutively - removed sequence number . This is one less than the minimum remaining sequence number .
11,727
public synchronized String getCheckpointedValue ( ) { int index = ( int ) ( getCheckpointedSequence ( ) - firstValueSequence ) ; return ( index >= 0 ) ? values . get ( index ) : null ; }
Returns the value associated with the checkpointedSequence .
11,728
public static void serialize ( Serializable obj , ByteArrayOutputStream bout ) { try { ObjectOutputStream out = new ObjectOutputStream ( bout ) ; out . writeObject ( obj ) ; out . close ( ) ; } catch ( IOException e ) { throw new IllegalStateException ( "Could not serialize " + obj , e ) ; } }
Serialize the given object into the given stream
11,729
public static List < String > readToList ( File f ) throws IOException { try ( final Reader reader = asReaderUTF8Lenient ( new FileInputStream ( f ) ) ) { return readToList ( reader ) ; } catch ( IOException ioe ) { throw new IllegalStateException ( String . format ( "Failed to read %s: %s" , f . getAbsolutePath ( ) , ...
Read the file line for line and return the result in a list
11,730
public static List < String > readToList ( Reader r ) throws IOException { try ( BufferedReader in = new BufferedReader ( r ) ) { List < String > l = new ArrayList < > ( ) ; String line = null ; while ( ( line = in . readLine ( ) ) != null ) l . add ( line ) ; return Collections . unmodifiableList ( l ) ; } }
Read the Reader line for line and return the result in a list
11,731
public static String readFileToString ( File f ) throws IOException { StringWriter sw = new StringWriter ( ) ; IO . copyAndCloseBoth ( Common . asReaderUTF8Lenient ( new FileInputStream ( f ) ) , sw ) ; return sw . toString ( ) ; }
Read the contents of the given file into a string
11,732
public void appendToLog ( String logAppendMessage ) { ProfilingTimerNode currentNode = current . get ( ) ; if ( currentNode != null ) { currentNode . appendToLog ( logAppendMessage ) ; } }
Append the given string to the log message of the current subtask
11,733
public void mergeTree ( ProfilingTimerNode otherRoot ) { ProfilingTimerNode currentNode = current . get ( ) ; Preconditions . checkNotNull ( currentNode ) ; mergeOrAddNode ( currentNode , otherRoot ) ; }
Merges the specified tree as a child under the current node .
11,734
private static void writeToLog ( int level , long totalNanos , long count , ProfilingTimerNode parent , String taskName , Log log , String logAppendMessage ) { if ( log == null ) { return ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < level ; i ++ ) { sb . append ( '\t' ) ; } String durationText =...
Writes one profiling line of information to the log
11,735
public static < T extends TBase > String serializeJson ( T obj ) throws TException { return new TSerializer ( new TJSONProtocol . Factory ( ) ) . toString ( obj , THRIFT_CHARSET ) ; }
Serialize a JSON - encoded thrift object
11,736
public static < T extends TBase > T deserializeJson ( T dest , String thriftJson ) throws TException { new TDeserializer ( new TJSONProtocol . Factory ( ) ) . deserialize ( dest , thriftJson , THRIFT_CHARSET ) ; return dest ; }
Deserialize a JSON - encoded thrift object
11,737
public static String sepList ( String sep , Iterable < ? > os , int max ) { return sepList ( sep , null , os , max ) ; }
Same as sepList with no wrapping
11,738
Word2VecModel train ( Log log , TrainingProgressListener listener , Iterable < List < String > > sentences ) throws InterruptedException { try ( ProfilingTimer timer = ProfilingTimer . createLoggingSubtasks ( log , "Training word2vec" ) ) { final Multiset < String > counts ; try ( AC ac = timer . start ( "Acquiring wor...
Train a model using the given data
11,739
private void normalize ( ) { for ( int i = 0 ; i < vocab . size ( ) ; ++ i ) { double len = 0 ; for ( int j = i * layerSize ; j < ( i + 1 ) * layerSize ; ++ j ) len += vectors . get ( j ) * vectors . get ( j ) ; len = Math . sqrt ( len ) ; for ( int j = i * layerSize ; j < ( i + 1 ) * layerSize ; ++ j ) vectors . put (...
Normalizes the vectors in this model
11,740
protected void init ( ) throws IOException { if ( internalIn2 != null ) return ; String encoding ; byte bom [ ] = new byte [ BOM_SIZE ] ; int n , unread ; n = internalIn . read ( bom , 0 , bom . length ) ; if ( ( bom [ 0 ] == ( byte ) 0x00 ) && ( bom [ 1 ] == ( byte ) 0x00 ) && ( bom [ 2 ] == ( byte ) 0xFE ) && ( bom [...
Read - ahead four bytes and check for BOM . Extra bytes are unread back to the stream only BOM bytes are skipped .
11,741
public static File getDir ( File parent , String item ) { File dir = new File ( parent , item ) ; return ( dir . exists ( ) && dir . isDirectory ( ) ) ? dir : null ; }
Returns a subdirectory of a given directory ; the subdirectory is expected to already exist .
11,742
public static boolean deleteRecursive ( final File file ) { boolean result = true ; if ( file . isDirectory ( ) ) { for ( final File inner : file . listFiles ( ) ) { result &= deleteRecursive ( inner ) ; } } return result & file . delete ( ) ; }
Deletes a file or directory . If the file is a directory it recursively deletes it .
11,743
public static File createTempFile ( byte [ ] fileContents , String namePrefix , String extension ) throws IOException { Preconditions . checkNotNull ( fileContents , "file contents missing" ) ; File tempFile = File . createTempFile ( namePrefix , extension ) ; try ( FileOutputStream fos = new FileOutputStream ( tempFil...
Stores the given contents into a temporary file
11,744
public static void demoWord ( ) throws IOException , TException , InterruptedException , UnknownWordException { File f = new File ( "text8" ) ; if ( ! f . exists ( ) ) throw new IllegalStateException ( "Please download and unzip the text8 example from http://mattmahoney.net/dc/text8.zip" ) ; List < String > read = Comm...
Trains a model and allows user to find similar words demo - word . sh example from the open source C implementation
11,745
public static void loadModel ( ) throws IOException , TException , UnknownWordException { final Word2VecModel model ; try ( ProfilingTimer timer = ProfilingTimer . create ( LOG , "Loading model" ) ) { String json = Common . readFileToString ( new File ( "text8.model" ) ) ; model = Word2VecModel . fromThrift ( ThriftUti...
Loads a model and allows user to find similar words
11,746
public static void skipGram ( ) throws IOException , TException , InterruptedException , UnknownWordException { List < String > read = Common . readToList ( new File ( "sents.cleaned.word2vec.txt" ) ) ; List < List < String > > partitioned = Lists . transform ( read , new Function < String , List < String > > ( ) { pub...
Example using Skip - Gram model
11,747
private Catalogo copy ( Catalogo catalogo ) throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; dbf . setNamespaceAware ( true ) ; DocumentBuilder db = dbf . newDocumentBuilder ( ) ; Document doc = db . newDocument ( ) ; Marshaller m = context . createMarshaller ( ) ; m . marshal ...
Defensive deep - copy
11,748
private String [ ] findFeatureByScenarioName ( String scenarioName ) throws IllegalAccessException { List < Description > testClasses = findTestClassesLevel ( parentDescription . getChildren ( ) ) ; for ( Description testClass : testClasses ) { List < Description > features = findFeaturesLevel ( testClass . getChildren...
Find feature and story for given scenario
11,749
Stories getStoriesAnnotation ( final String [ ] value ) { return new Stories ( ) { public String [ ] value ( ) { return value ; } public Class < Stories > annotationType ( ) { return Stories . class ; } } ; }
Creates Story annotation object
11,750
Features getFeaturesAnnotation ( final String [ ] value ) { return new Features ( ) { public String [ ] value ( ) { return value ; } public Class < Features > annotationType ( ) { return Features . class ; } } ; }
Creates Feature annotation object
11,751
public < E extends Enum < E > > List < E > getTypeList ( Class < E > clz , E [ ] typeList ) { if ( typeList . length > 0 ) { return new ArrayList < > ( Arrays . asList ( typeList ) ) ; } else { return new ArrayList < > ( EnumSet . allOf ( clz ) ) ; } }
Get a list of the enums passed
11,752
public ExternalID getPersonExternalIds ( int personId ) throws MovieDbException { TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . ID , personId ) ; URL url = new ApiUrl ( apiKey , MethodBase . PERSON ) . subMethod ( MethodSub . EXTERNAL_IDS ) . buildUrl ( parameters ) ; String webpage = ...
Get the external ids for a specific person id .
11,753
public ResultList < Artwork > getPersonImages ( int personId ) throws MovieDbException { TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . ID , personId ) ; URL url = new ApiUrl ( apiKey , MethodBase . PERSON ) . subMethod ( MethodSub . IMAGES ) . buildUrl ( parameters ) ; String webpage =...
Get the images for a specific person id .
11,754
public ResultList < PersonFind > getPersonPopular ( Integer page ) throws MovieDbException { TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . PAGE , page ) ; URL url = new ApiUrl ( apiKey , MethodBase . PERSON ) . subMethod ( MethodSub . POPULAR ) . buildUrl ( parameters ) ; WrapperGeneri...
Get the list of popular people on The Movie Database .
11,755
public List < Artwork > getAll ( ArtworkType ... artworkList ) { List < Artwork > artwork = new ArrayList < > ( ) ; List < ArtworkType > types ; if ( artworkList . length > 0 ) { types = new ArrayList < > ( Arrays . asList ( artworkList ) ) ; } else { types = new ArrayList < > ( Arrays . asList ( ArtworkType . values (...
Return a list of all the artwork with their types .
11,756
private void updateArtworkType ( List < Artwork > artworkList , ArtworkType type ) { for ( Artwork artwork : artworkList ) { artwork . setArtworkType ( type ) ; } }
Update the artwork type for the artwork list
11,757
public TokenAuthorisation getAuthorisationToken ( ) throws MovieDbException { TmdbParameters parameters = new TmdbParameters ( ) ; URL url = new ApiUrl ( apiKey , MethodBase . AUTH ) . subMethod ( MethodSub . TOKEN_NEW ) . buildUrl ( parameters ) ; String webpage = httpTools . getRequest ( url ) ; try { return MAPPER ....
This method is used to generate a valid request token for user based authentication .
11,758
public TokenSession getSessionToken ( TokenAuthorisation token ) throws MovieDbException { TmdbParameters parameters = new TmdbParameters ( ) ; if ( ! token . getSuccess ( ) ) { throw new MovieDbException ( ApiExceptionType . AUTH_FAILURE , "Authorisation token was not successful!" ) ; } parameters . add ( Param . TOKE...
This method is used to generate a session id for user based authentication .
11,759
public TokenSession getGuestSessionToken ( ) throws MovieDbException { URL url = new ApiUrl ( apiKey , MethodBase . AUTH ) . subMethod ( MethodSub . GUEST_SESSION ) . buildUrl ( ) ; String webpage = httpTools . getRequest ( url ) ; try { return MAPPER . readValue ( webpage , TokenSession . class ) ; } catch ( IOExcepti...
This method is used to generate a guest session id .
11,760
private void initialise ( String apiKey , HttpTools httpTools ) { tmdbAccount = new TmdbAccount ( apiKey , httpTools ) ; tmdbAuth = new TmdbAuthentication ( apiKey , httpTools ) ; tmdbCertifications = new TmdbCertifications ( apiKey , httpTools ) ; tmdbChanges = new TmdbChanges ( apiKey , httpTools ) ; tmdbCollections ...
Initialise the sub - classes once the API key and http client are known
11,761
public ResultList < MovieBasic > getFavoriteMovies ( String sessionId , int accountId ) throws MovieDbException { return tmdbAccount . getFavoriteMovies ( sessionId , accountId ) ; }
Get the account favourite movies
11,762
public StatusCode modifyFavoriteStatus ( String sessionId , int accountId , Integer mediaId , MediaType mediaType , boolean isFavorite ) throws MovieDbException { return tmdbAccount . modifyFavoriteStatus ( sessionId , accountId , mediaType , mediaId , isFavorite ) ; }
Add or remove a movie to an accounts favourite list .
11,763
public ResultList < TVBasic > getWatchListTV ( String sessionId , int accountId , Integer page , String sortBy , String language ) throws MovieDbException { return tmdbAccount . getWatchListTV ( sessionId , accountId , page , sortBy , language ) ; }
Get the list of movies on an accounts watchlist .
11,764
public StatusCode addToWatchList ( String sessionId , int accountId , MediaType mediaType , Integer mediaId ) throws MovieDbException { return tmdbAccount . modifyWatchList ( sessionId , accountId , mediaType , mediaId , true ) ; }
Add a movie to an accounts watch list .
11,765
public StatusCode removeFromWatchList ( String sessionId , int accountId , MediaType mediaType , Integer mediaId ) throws MovieDbException { return tmdbAccount . modifyWatchList ( sessionId , accountId , mediaType , mediaId , false ) ; }
Remove a movie from an accounts watch list .
11,766
public ResultList < TVBasic > getFavoriteTv ( String sessionId , int accountId ) throws MovieDbException { return tmdbAccount . getFavoriteTv ( sessionId , accountId ) ; }
Get the list of favorite TV series for an account .
11,767
public ResultList < ChangeListItem > getMovieChangeList ( Integer page , String startDate , String endDate ) throws MovieDbException { return tmdbChanges . getChangeList ( MethodBase . MOVIE , page , startDate , endDate ) ; }
Get a list of Movie IDs that have been edited .
11,768
public ResultList < ChangeListItem > getTvChangeList ( Integer page , String startDate , String endDate ) throws MovieDbException { return tmdbChanges . getChangeList ( MethodBase . TV , page , startDate , endDate ) ; }
Get a list of TV IDs that have been edited .
11,769
public ResultList < ChangeListItem > getPersonChangeList ( Integer page , String startDate , String endDate ) throws MovieDbException { return tmdbChanges . getChangeList ( MethodBase . PERSON , page , startDate , endDate ) ; }
Get a list of PersonInfo IDs that have been edited .
11,770
public ResultList < MovieBasic > getGenreMovies ( int genreId , String language , Integer page , Boolean includeAllMovies , Boolean includeAdult ) throws MovieDbException { return tmdbGenre . getGenreMovies ( genreId , language , page , includeAllMovies , includeAdult ) ; }
Get a list of movies per genre .
11,771
public boolean checkItemStatus ( String listId , Integer mediaId ) throws MovieDbException { return tmdbList . checkItemStatus ( listId , mediaId ) ; }
Check to see if an item is already on a list .
11,772
public StatusCode removeItemFromList ( String sessionId , String listId , Integer mediaId ) throws MovieDbException { return tmdbList . removeItem ( sessionId , listId , mediaId ) ; }
This method lets users remove items from a list that they created .
11,773
public ResultList < Video > getMovieVideos ( int movieId , String language ) throws MovieDbException { return tmdbMovies . getMovieVideos ( movieId , language ) ; }
This method is used to retrieve all of the trailers for a particular movie .
11,774
public ResultList < Review > getMovieReviews ( int movieId , Integer page , String language ) throws MovieDbException { return tmdbMovies . getMovieReviews ( movieId , page , language ) ; }
Get the reviews for a particular movie id .
11,775
public ResultList < UserList > getMovieLists ( int movieId , Integer page , String language ) throws MovieDbException { return tmdbMovies . getMovieLists ( movieId , page , language ) ; }
Get the lists that the movie belongs to
11,776
public ResultList < MovieInfo > getTopRatedMovies ( Integer page , String language ) throws MovieDbException { return tmdbMovies . getTopRatedMovies ( page , language ) ; }
This method is used to retrieve the top rated movies that have over 10 votes on TMDb .
11,777
public PersonCreditList < CreditTVBasic > getPersonTVCredits ( int personId , String language ) throws MovieDbException { return tmdbPeople . getPersonTVCredits ( personId , language ) ; }
Get the TV credits for a specific person id .
11,778
public ResultList < ChangeKeyItem > getPersonChanges ( int personId , String startDate , String endDate ) throws MovieDbException { return tmdbPeople . getPersonChanges ( personId , startDate , endDate ) ; }
Get the changes for a specific person id .
11,779
public ResultList < Keyword > searchKeyword ( String query , Integer page ) throws MovieDbException { return tmdbSearch . searchKeyword ( query , page ) ; }
Search for keywords by name
11,780
public MediaState getTVAccountState ( int tvID , String sessionID ) throws MovieDbException { return tmdbTv . getTVAccountState ( tvID , sessionID ) ; }
This method lets users get the status of whether or not the TV show has been rated or added to their favourite or watch lists .
11,781
public ExternalID getTVExternalIDs ( int tvID , String language ) throws MovieDbException { return tmdbTv . getTVExternalIDs ( tvID , language ) ; }
Get the external ids that we have stored for a TV series .
11,782
public StatusCode postTVRating ( int tvID , int rating , String sessionID , String guestSessionID ) throws MovieDbException { return tmdbTv . postTVRating ( tvID , rating , sessionID , guestSessionID ) ; }
This method lets users rate a TV show .
11,783
public ResultList < TVInfo > getTVSimilar ( int tvID , Integer page , String language ) throws MovieDbException { return tmdbTv . getTVSimilar ( tvID , page , language ) ; }
Get the similar TV shows for a specific tv id .
11,784
public ResultList < TVInfo > getTVOnTheAir ( Integer page , String language ) throws MovieDbException { return tmdbTv . getTVOnTheAir ( page , language ) ; }
Get the list of TV shows that are currently on the air .
11,785
public ResultList < TVInfo > getTVAiringToday ( Integer page , String language , String timezone ) throws MovieDbException { return tmdbTv . getTVAiringToday ( page , language , timezone ) ; }
Get the list of TV shows that air today .
11,786
public ExternalID getSeasonExternalID ( int tvID , int seasonNumber , String language ) throws MovieDbException { return tmdbSeasons . getSeasonExternalID ( tvID , seasonNumber , language ) ; }
Get the external ids that we have stored for a TV season by season number .
11,787
public ResultList < Artwork > getSeasonImages ( int tvID , int seasonNumber , String language , String ... includeImageLanguage ) throws MovieDbException { return tmdbSeasons . getSeasonImages ( tvID , seasonNumber , language , includeImageLanguage ) ; }
Get the images that we have stored for a TV season by season number .
11,788
public MediaCreditList getEpisodeCredits ( int tvID , int seasonNumber , int episodeNumber ) throws MovieDbException { return tmdbEpisodes . getEpisodeCredits ( tvID , seasonNumber , episodeNumber ) ; }
Get the TV episode credits by combination of season and episode number .
11,789
public ExternalID getEpisodeExternalID ( int tvID , int seasonNumber , int episodeNumber , String language ) throws MovieDbException { return tmdbEpisodes . getEpisodeExternalID ( tvID , seasonNumber , episodeNumber , language ) ; }
Get the external ids for a TV episode by comabination of a season and episode number .
11,790
public ResultsMap < String , List < Certification > > getMoviesCertification ( ) throws MovieDbException { URL url = new ApiUrl ( apiKey , MethodBase . CERTIFICATION ) . subMethod ( MethodSub . MOVIE_LIST ) . buildUrl ( ) ; String webpage = httpTools . getRequest ( url ) ; try { JsonNode node = MAPPER . readTree ( webp...
Get a list of movies certification .
11,791
private static boolean compareTitles ( String primaryTitle , String firstCompareTitle , String secondCompareTitle , int maxDistance ) { if ( compareDistance ( primaryTitle , firstCompareTitle , maxDistance ) ) { return true ; } return compareDistance ( primaryTitle , secondCompareTitle , maxDistance ) ; }
Compare a title with two other titles .
11,792
public static boolean movies ( final MovieInfo moviedb , final String title , final String year , int maxDistance ) { return Compare . movies ( moviedb , title , year , maxDistance , true ) ; }
Compare the MovieDB object with a title and year case sensitive
11,793
private static boolean compareDistance ( final String title1 , final String title2 , int distance ) { return StringUtils . getLevenshteinDistance ( title1 , title2 ) <= distance ; }
Compare the Levenshtein Distance between the two strings
11,794
public MediaCreditList getMovieCredits ( int movieId ) throws MovieDbException { TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . ID , movieId ) ; URL url = new ApiUrl ( apiKey , MethodBase . MOVIE ) . subMethod ( MethodSub . CREDITS ) . buildUrl ( parameters ) ; String webpage = httpTool...
Get the cast and crew information for a specific movie id .
11,795
public ResultList < Keyword > getMovieKeywords ( int movieId ) throws MovieDbException { TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . ID , movieId ) ; URL url = new ApiUrl ( apiKey , MethodBase . MOVIE ) . subMethod ( MethodSub . KEYWORDS ) . buildUrl ( parameters ) ; String webpage =...
This method is used to retrieve all of the keywords that have been added to a particular movie .
11,796
public ResultList < MovieInfo > getRecommendations ( int movieId , String language ) throws MovieDbException { TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . ID , movieId ) ; parameters . add ( Param . LANGUAGE , language ) ; URL url = new ApiUrl ( apiKey , MethodBase . MOVIE ) . subMet...
The recommendations method will let you retrieve the movie recommendations for a particular movie .
11,797
public ResultList < ReleaseDates > getReleaseDates ( int movieId ) throws MovieDbException { TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . ID , movieId ) ; URL url = new ApiUrl ( apiKey , MethodBase . MOVIE ) . subMethod ( MethodSub . RELEASE_DATES ) . buildUrl ( parameters ) ; Wrapper...
Get the release dates certifications and related information by country for a specific movie id .
11,798
public ResultList < Translation > getMovieTranslations ( int movieId ) throws MovieDbException { TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . ID , movieId ) ; URL url = new ApiUrl ( apiKey , MethodBase . MOVIE ) . subMethod ( MethodSub . TRANSLATIONS ) . buildUrl ( parameters ) ; Stri...
This method is used to retrieve a list of the available translations for a specific movie .
11,799
public ResultList < ChangeKeyItem > getMovieChanges ( int movieId , String startDate , String endDate ) throws MovieDbException { return getMediaChanges ( movieId , startDate , endDate ) ; }
Get the changes for a specific movie ID .