Package adams.data.twitter
Class SimulatedURLEntity
- java.lang.Object
-
- adams.data.twitter.SimulatedURLEntity
-
- All Implemented Interfaces:
Serializable
,twitter4j.TweetEntity
,twitter4j.URLEntity
public class SimulatedURLEntity extends Object implements twitter4j.URLEntity, Serializable
Encapsulates a URL entity for simulating tweets.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_DisplayURL
the display URL.protected int
m_End
the end index in the tweet.protected String
m_ExpandedURL
the expaneded URL.protected int
m_Start
the start index in the tweet.protected String
m_URL
the URL.
-
Constructor Summary
Constructors Constructor Description SimulatedURLEntity()
Initializes the entity.SimulatedURLEntity(String url)
Initializes the entity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDisplayURL()
Returns the display URL if mentioned URL is shorten.int
getEnd()
Returns the index of the end character of the URL mentioned in the tweet.String
getExpandedURL()
Returns the expanded URL.int
getStart()
Returns the index of the start character of the URL mentioned in the tweet.String
getText()
Returns the URL mentioned in the tweet.
This method implementation is to meet TweetEntity interface and the behavior is equivalent togetURL()
String
getURL()
Returns the URL mentioned in the tweet.protected void
initialize()
Initializes the members.void
setDisplayURL(String value)
Sets the display URL if mentioned URL is shorten.void
setEnd(int value)
Sets the index of the end character of the URL mentioned in the tweet.void
setExpandedURL(String value)
Sets the expanded URL.void
setStart(int value)
Sets the index of the start character of the URL mentioned in the tweet.void
setURL(String value)
Sets the URL mentioned in the tweet.String
toString()
Returns the URL.
-
-
-
Constructor Detail
-
SimulatedURLEntity
public SimulatedURLEntity()
Initializes the entity.
-
SimulatedURLEntity
public SimulatedURLEntity(String url)
Initializes the entity.- Parameters:
url
- the URL to be used for all URLs
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.
-
setURL
public void setURL(String value)
Sets the URL mentioned in the tweet.- Parameters:
value
- the mentioned URL
-
getURL
public String getURL()
Returns the URL mentioned in the tweet.- Specified by:
getURL
in interfacetwitter4j.URLEntity
- Returns:
- the mentioned URL
-
setExpandedURL
public void setExpandedURL(String value)
Sets the expanded URL.- Parameters:
value
- the expanded URL
-
getExpandedURL
public String getExpandedURL()
Returns the expanded URL.- Specified by:
getExpandedURL
in interfacetwitter4j.URLEntity
- Returns:
- the expanded URL
-
setDisplayURL
public void setDisplayURL(String value)
Sets the display URL if mentioned URL is shorten.- Parameters:
value
- the display URL if mentioned URL is shorten, or null if no shorten URL was mentioned.
-
getDisplayURL
public String getDisplayURL()
Returns the display URL if mentioned URL is shorten.- Specified by:
getDisplayURL
in interfacetwitter4j.URLEntity
- Returns:
- the display URL if mentioned URL is shorten, or null if no shorten URL was mentioned.
-
setStart
public void setStart(int value)
Sets the index of the start character of the URL mentioned in the tweet.- Parameters:
value
- the index of the start character of the URL mentioned in the tweet
-
getStart
public int getStart()
Returns the index of the start character of the URL mentioned in the tweet.- Specified by:
getStart
in interfacetwitter4j.TweetEntity
- Specified by:
getStart
in interfacetwitter4j.URLEntity
- Returns:
- the index of the start character of the URL mentioned in the tweet
-
setEnd
public void setEnd(int value)
Sets the index of the end character of the URL mentioned in the tweet.- Parameters:
value
- the index of the end character of the URL mentioned in the tweet
-
getEnd
public int getEnd()
Returns the index of the end character of the URL mentioned in the tweet.- Specified by:
getEnd
in interfacetwitter4j.TweetEntity
- Specified by:
getEnd
in interfacetwitter4j.URLEntity
- Returns:
- the index of the end character of the URL mentioned in the tweet
-
getText
public String getText()
Returns the URL mentioned in the tweet.
This method implementation is to meet TweetEntity interface and the behavior is equivalent togetURL()
- Specified by:
getText
in interfacetwitter4j.TweetEntity
- Specified by:
getText
in interfacetwitter4j.URLEntity
- Returns:
- the mentioned URL
- See Also:
getURL()
-
-