Bridges-Java-2.3.2  2.3.2
Bridges(JavaAPI)
Static Public Member Functions | Protected Member Functions | List of all members
bridges.connect.DataFormatter Class Reference

Static Public Member Functions

static String getServerURL ()
 
static void setServerURL (String server_url)
 
static StringBuilder trimComma (StringBuilder in)
 
static List< FollowergetAssociations (Follower identifier, int max)
 
static List< TweetgetAssociations (TwitterAccount identifier, int max)
 
static List< EarthquakeUSGSgetAssociations (USGSaccount identifier, int max)
 
static List< EarthquakeTweetconvertTweet (List< Tweet > aList)
 
static List< ActorgetAssociations (Actor identifier, int max)
 
static List< MoviegetAssociations (Movie identifier, int max)
 
static List< Tweetnext (List< Tweet > aList, int max)
 
static List< EarthquakeUSGSnext (List< EarthquakeUSGS > aList, int max, USGSaccount acu)
 
static int validNumberOfTweets (int max)
 
static double getEdgeWeight (String source, String target)
 
static ArrayList< EarthquakeUSGSgetEarthquakeUSGSData (USGSaccount acctName, int maxElem) throws Exception
 
static ArrayList< ActorMovieIMDBgetActorMovieIMDBData (String name, int maxElem) throws Exception
 
static ArrayList< GutenbergBookgetGutenbergBookMetaData () throws Exception
 
static ArrayList< GamegetGameData () throws Exception
 
static ArrayList< ShakespearegetShakespeareData () throws Exception
 

Protected Member Functions

 DataFormatter ()
 
Connector getBackend ()
 
void setBackend (Connector backend)
 

Detailed Description

Connection to the DataFormatters server.

Initialize this class before using it, and call complete() afterward.

Author
Sean Gallagher
Parameters
<E>Mihai Mehedint

Constructor & Destructor Documentation

bridges.connect.DataFormatter.DataFormatter ( )
protected

Constructor

Member Function Documentation

static List<EarthquakeTweet> bridges.connect.DataFormatter.convertTweet ( List< Tweet aList)
static

This method change the tweet object into an earthquake tweet object with more data extracted from the tweet content, like magnitude

Parameters
aList
Returns
static ArrayList<ActorMovieIMDB> bridges.connect.DataFormatter.getActorMovieIMDBData ( String  name,
int  maxElem 
) throws Exception
static
static List<Follower> bridges.connect.DataFormatter.getAssociations ( Follower  identifier,
int  max 
)
static

Automatically choose whether to open a node identifier with: Twitter via followers(), TMDb with movies(), or RottenTomatoes with actors()

Parameters
identifier
max
Returns
a list of identifiers
Exceptions
QueryLimitExceptionThis Method returns the list of followers
Parameters
identifierholds the name of the
maxholds the max number of followers
Returns
static List<Tweet> bridges.connect.DataFormatter.getAssociations ( TwitterAccount  identifier,
int  max 
)
static

This Method returns the list of tweets

Parameters
identifierholds the name of the
maxholds the max number of tweets
Returns
Exceptions
MyExceptionClass
static List<EarthquakeUSGS> bridges.connect.DataFormatter.getAssociations ( USGSaccount  identifier,
int  max 
)
static

This Method returns the list of earthquakes

Parameters
identifierholds the name of the
maxholds the max number of earthquakes
Returns
Exceptions
MyExceptionClass
static List<Actor> bridges.connect.DataFormatter.getAssociations ( Actor  identifier,
int  max 
)
static

This Method returns the list of actors

Parameters
identifierholds the name of the movie
maxholds the max number of actors
Returns
static List<Movie> bridges.connect.DataFormatter.getAssociations ( Movie  identifier,
int  max 
)
static

This Method returns the list of movies

Parameters
identifierholds the name of the movie
maxholds the max number of movies
Returns
Connector bridges.connect.DataFormatter.getBackend ( )
protected
Returns
the backend
static ArrayList<EarthquakeUSGS> bridges.connect.DataFormatter.getEarthquakeUSGSData ( USGSaccount  acctName,
int  maxElem 
) throws Exception
static
static double bridges.connect.DataFormatter.getEdgeWeight ( String  source,
String  target 
)
static

Generate a sample Edge weight for two nodes

Parameters
source
target
Returns
static ArrayList<Game> bridges.connect.DataFormatter.getGameData ( ) throws Exception
static
static ArrayList<GutenbergBook> bridges.connect.DataFormatter.getGutenbergBookMetaData ( ) throws Exception
static
static String bridges.connect.DataFormatter.getServerURL ( )
static
static ArrayList<Shakespeare> bridges.connect.DataFormatter.getShakespeareData ( ) throws Exception
static
static List<Tweet> bridges.connect.DataFormatter.next ( List< Tweet aList,
int  max 
)
static

The next(List<Tweet>, int) method retrieves the next batch of tweets and adds deep copy of those tweets to the current list

Parameters
aListholds the reference to the current list of tweets
maxthe number of tweets in the new batch of tweets
Returns
the list of tweets containing the old and the new batch of tweets
Exceptions
MyExceptionClass
static List<EarthquakeUSGS> bridges.connect.DataFormatter.next ( List< EarthquakeUSGS aList,
int  max,
USGSaccount  acu 
)
static

The next(List<EarthquakeUSGS>, int) method retrieves the next batch of eq and adds deep copy of those eq to the current list

Parameters
aListholds the reference to the current list of eq
maxthe number of eq in the new batch of eq
Returns
the list of eq containing the old and the new batch of tweets
Exceptions
MyExceptionClass
void bridges.connect.DataFormatter.setBackend ( Connector  backend)
protected
Parameters
backendthe backend to set
static void bridges.connect.DataFormatter.setServerURL ( String  server_url)
static
static StringBuilder bridges.connect.DataFormatter.trimComma ( StringBuilder  in)
static

Internal method for JSON preparation

Parameters
inThe original string
Returns
a string with all but the last character
static int bridges.connect.DataFormatter.validNumberOfTweets ( int  max)
static

Check the validity of number of Tweets requested

Parameters
maxthe number of tweets
Returns
returns true if the number is in the range 0 - 500
Exceptions
MyExceptionClassotherwise

The documentation for this class was generated from the following file: