Author: ks156
Date: 2009-10-19 11:09:43 +0200 (Mon, 19 Oct 2009)
New Revision: 5722

Modified:
   
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java
   
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java
   
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java
   
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java
   
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java
Log:
* Retabed
* Removed trailing white spaces
* Reindented


Modified: 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java
===================================================================
--- 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java
    2009-10-19 09:05:21 UTC (rev 5721)
+++ 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java
    2009-10-19 09:09:43 UTC (rev 5722)
@@ -25,144 +25,144 @@
 
 public class Configuration extends SimplePluginConfiguration{
 
-       private String username = "";
-       private String password = "";
-       
-       private String myStatus = "Hello all from my tuxdroid Twitter gadget";
-       private boolean updateStatus = false;
-       
-       private boolean checkFriends = true;
-       private boolean checkMessages = true;
-       
-       private String defaultUser = "your_user_name";
-       private String defaultPassword = "_secret_";
-       
-       
-       /**
-        * Sets the username.
-        * @param username
-        */
-       public void setUsername(String username)
-       {
-               this.username = username;
-       }
-       
-       
-       /**
-        * Return the username.
-        * @return
-        */
-       public String getUsername()
-       {
-               if (this.username.equalsIgnoreCase(this.defaultUser))
-               {
-                       return null;
-               }
-               
-               return this.username;
-       }
-       
-       
-       /**
-        * Set the user password.
-        * @param password
-        */
-       public void setPassword(String password)
-       {
-               this.password = password;
-       }
-       
-       
-       /**
-        * Return the user password.
-        * @return
-        */
-       public String getPassword()
-       {
-               if (this.password.equalsIgnoreCase(this.defaultPassword))
-               {
-                       return null;
-               }
-               return this.password;
-       }
-       
-       
-       /**
-        * Sets the user status on twitter.
-        */
-       public void setMyStatus(String myStatus)
-       {
-               this.myStatus = myStatus;
-       }
-       
-       
-       /**
-        * Return the status to be set.
-        * @return
-        */
-       public String getMyStatus()
-       {
-               return this.myStatus;
-       }
-       
-       
-       /**
-        * Set or not the update request.
-        * @param updateStatus
-        */
-       public void setUpdateStatus(boolean updateStatus)
-       {
-               this.updateStatus = updateStatus;
-       }
-       
-       
-       /**
-        * Return true if user want to update his status.
-        * @return
-        */
-       public boolean getUpdateStatus()
-       {
-               return this.updateStatus;
-       }
-       
-       
-       /**
-        * Set or not the checkf friends updates check.
-        * @param updateStatus
-        */
-       public void setCheckFriends(boolean aCheckFriends)
-       {
-               this.checkFriends = aCheckFriends;
-       }
-       
-       
-       /**
-        * Return true if user want to check his new friends statuses.
-        * @return
-        */
-       public boolean getCheckFriends()
-       {
-               return this.checkFriends;
-       }
-       
-       
-       /**
-        * Set or not the check messages option.
-        * @param updateStatus
-        */
-       public void setCheckMessages(boolean aCheckMessages)
-       {
-               this.checkMessages = aCheckMessages;
-       }
-       
-       
-       /**
-        * Return true if user want to check his replies / messages.
-        * @return
-        */
-       public boolean getCheckMessages()
-       {
-               return this.checkMessages;
-       }
+    private String username = "";
+    private String password = "";
 
+    private String myStatus = "Hello all from my tuxdroid Twitter gadget";
+    private boolean updateStatus = false;
+
+    private boolean checkFriends = true;
+    private boolean checkMessages = true;
+
+    private String defaultUser = "your_user_name";
+    private String defaultPassword = "_secret_";
+
+
+    /**
+     * Sets the username.
+     * @param username
+     */
+    public void setUsername(String username)
+    {
+        this.username = username;
+    }
+
+
+    /**
+     * Return the username.
+     * @return
+     */
+    public String getUsername()
+    {
+        if (this.username.equalsIgnoreCase(this.defaultUser))
+        {
+            return null;
+        }
+
+        return this.username;
+    }
+
+
+    /**
+     * Set the user password.
+     * @param password
+     */
+    public void setPassword(String password)
+    {
+        this.password = password;
+    }
+
+
+    /**
+     * Return the user password.
+     * @return
+     */
+    public String getPassword()
+    {
+        if (this.password.equalsIgnoreCase(this.defaultPassword))
+        {
+            return null;
+        }
+        return this.password;
+    }
+
+
+    /**
+     * Sets the user status on twitter.
+     */
+    public void setMyStatus(String myStatus)
+    {
+        this.myStatus = myStatus;
+    }
+
+
+    /**
+     * Return the status to be set.
+     * @return
+     */
+    public String getMyStatus()
+    {
+        return this.myStatus;
+    }
+
+
+    /**
+     * Set or not the update request.
+     * @param updateStatus
+     */
+    public void setUpdateStatus(boolean updateStatus)
+    {
+        this.updateStatus = updateStatus;
+    }
+
+
+    /**
+     * Return true if user want to update his status.
+     * @return
+     */
+    public boolean getUpdateStatus()
+    {
+        return this.updateStatus;
+    }
+
+
+    /**
+     * Set or not the checkf friends updates check.
+     * @param updateStatus
+     */
+    public void setCheckFriends(boolean aCheckFriends)
+    {
+        this.checkFriends = aCheckFriends;
+    }
+
+
+    /**
+     * Return true if user want to check his new friends statuses.
+     * @return
+     */
+    public boolean getCheckFriends()
+    {
+        return this.checkFriends;
+    }
+
+
+    /**
+     * Set or not the check messages option.
+     * @param updateStatus
+     */
+    public void setCheckMessages(boolean aCheckMessages)
+    {
+        this.checkMessages = aCheckMessages;
+    }
+
+
+    /**
+     * Return true if user want to check his replies / messages.
+     * @return
+     */
+    public boolean getCheckMessages()
+    {
+        return this.checkMessages;
+    }
+
 }

Modified: 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java
===================================================================
--- 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java
     2009-10-19 09:05:21 UTC (rev 5721)
+++ 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java
     2009-10-19 09:09:43 UTC (rev 5722)
@@ -23,59 +23,59 @@
 
 public class FriendStatut implements Serializable{
 
-       private static final long serialVersionUID = -2710016821846315218L;
+    private static final long serialVersionUID = -2710016821846315218L;
 
-       private String friend = null;
-       private String Status = null;
-       
-       /**
-        * Constructor.
-        * @param friendName
-        * @param status
-        */
-       public FriendStatut(String friendName, String status)
-       {
-               this.friend = friendName;
-               this.Status = status;
-       }
-       
-       
-       /**
-        * Return the friend name.
-        * @return
-        */
-       public String getFriendName()
-       {
-               return this.friend;
-       }
-       
-       
-       /**
-        * Return the friend status.
-        * @return
-        */
-       public String getFriendStatus()
-       {
-               return this.Status;
-       }
-       
-       
-       /**
-        * Set the friend name.
-        * @param aFriendName
-        */
-       public void setFriendName(String aFriendName)
-       {
-               this.friend = aFriendName;
-       }
-       
-       
-       /**
-        * Set the friend status.
-        * @param aFriendStatus
-        */
-       public void setFriendStatus(String aFriendStatus)
-       {
-               this.Status = aFriendStatus;
-       }
+    private String friend = null;
+    private String Status = null;
+
+    /**
+     * Constructor.
+     * @param friendName
+     * @param status
+     */
+    public FriendStatut(String friendName, String status)
+    {
+        this.friend = friendName;
+        this.Status = status;
+    }
+
+
+    /**
+     * Return the friend name.
+     * @return
+     */
+    public String getFriendName()
+    {
+        return this.friend;
+    }
+
+
+    /**
+     * Return the friend status.
+     * @return
+     */
+    public String getFriendStatus()
+    {
+        return this.Status;
+    }
+
+
+    /**
+     * Set the friend name.
+     * @param aFriendName
+     */
+    public void setFriendName(String aFriendName)
+    {
+        this.friend = aFriendName;
+    }
+
+
+    /**
+     * Set the friend status.
+     * @param aFriendStatus
+     */
+    public void setFriendStatus(String aFriendStatus)
+    {
+        this.Status = aFriendStatus;
+    }
 }

Modified: 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java
===================================================================
--- 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java
  2009-10-19 09:05:21 UTC (rev 5721)
+++ 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java
  2009-10-19 09:09:43 UTC (rev 5722)
@@ -23,60 +23,60 @@
 
 public class Message implements Serializable{
 
-       private static final long serialVersionUID = -2723363051271966964L;
+    private static final long serialVersionUID = -2723363051271966964L;
 
-       private String sender = null;
-       private String message = null;
-       
-       /**
-        * Constructor.
-        * @param sender
-        * @param message
-        */
-       public Message(String sender, String message)
-       {
-               this.sender = sender;
-               this.message = message;
-       }
-       
-       
-       /**
-        * Return the message sender.
-        * @return
-        */
-       public String getSender()
-       {
-               return this.sender;
-       }
-       
-       
-       /**
-        * Return the message itself.
-        * @return
-        */
-       public String getMessage()
-       {
-               return this.message;
-       }
-       
-       
-       /**
-        * Set the message.
-        * @param aMessage
-        */
-       public void setMessage(String aMessage)
-       {
-               this.message = aMessage;
-       }
-       
-       
-       /**
-        * Set the sender.
-        * @param aSender
-        */
-       public void setSender(String aSender)
-       {
-               this.sender = aSender;
-       }
-       
+    private String sender = null;
+    private String message = null;
+
+    /**
+     * Constructor.
+     * @param sender
+     * @param message
+     */
+    public Message(String sender, String message)
+    {
+        this.sender = sender;
+        this.message = message;
+    }
+
+
+    /**
+     * Return the message sender.
+     * @return
+     */
+    public String getSender()
+    {
+        return this.sender;
+    }
+
+
+    /**
+     * Return the message itself.
+     * @return
+     */
+    public String getMessage()
+    {
+        return this.message;
+    }
+
+
+    /**
+     * Set the message.
+     * @param aMessage
+     */
+    public void setMessage(String aMessage)
+    {
+        this.message = aMessage;
+    }
+
+
+    /**
+     * Set the sender.
+     * @param aSender
+     */
+    public void setSender(String aSender)
+    {
+        this.sender = aSender;
+    }
+
 }

Modified: 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java
===================================================================
--- 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java
    2009-10-19 09:05:21 UTC (rev 5721)
+++ 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java
    2009-10-19 09:09:43 UTC (rev 5722)
@@ -23,59 +23,59 @@
 
 public class Reply implements Serializable{
 
-       private static final long serialVersionUID = -4131206164350955300L;
+    private static final long serialVersionUID = -4131206164350955300L;
 
-       private String sender = null;
-       private String reply = null;
-       
-       /**
-        * Constructor.
-        * @param sender
-        * @param reply
-        */
-       public Reply(String sender, String reply)
-       {
-               this.sender = sender;
-               this.reply = reply;
-       }
-       
-       
-       /**
-        * Return the reply sender.
-        * @return
-        */
-       public String getSender()
-       {
-               return this.sender;
-       }
-       
-       
-       /**
-        * Return the reply itself.
-        * @return
-        */
-       public String getReply()
-       {
-               return this.reply;
-       }
-       
-       
-       /**
-        * Set the reply sender.
-        * @param aSender
-        */
-       public void setSender(String aSender)
-       {
-               this.sender = aSender;
-       }
-       
-       
-       /**
-        * Set the message itself.
-        * @param aReply
-        */
-       public void setReply(String aReply)
-       {
-               this.reply = aReply;
-       }
+    private String sender = null;
+    private String reply = null;
+
+    /**
+     * Constructor.
+     * @param sender
+     * @param reply
+     */
+    public Reply(String sender, String reply)
+    {
+        this.sender = sender;
+        this.reply = reply;
+    }
+
+
+    /**
+     * Return the reply sender.
+     * @return
+     */
+    public String getSender()
+    {
+        return this.sender;
+    }
+
+
+    /**
+     * Return the reply itself.
+     * @return
+     */
+    public String getReply()
+    {
+        return this.reply;
+    }
+
+
+    /**
+     * Set the reply sender.
+     * @param aSender
+     */
+    public void setSender(String aSender)
+    {
+        this.sender = aSender;
+    }
+
+
+    /**
+     * Set the message itself.
+     * @param aReply
+     */
+    public void setReply(String aReply)
+    {
+        this.reply = aReply;
+    }
 }

Modified: 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java
===================================================================
--- 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java
       2009-10-19 09:05:21 UTC (rev 5721)
+++ 
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java
       2009-10-19 09:09:43 UTC (rev 5722)
@@ -28,285 +28,285 @@
 import java.util.Vector;
 
 
-public class TwitterDatasStruct extends Object implements Serializable{
+public class TwitterDatasStruct extends Object implements Serializable {
 
-       private static final long serialVersionUID = 8395814134877723558L;
-       
-       public static final byte FRIENDS_STATUSES = 0;
-       public static final byte REPLIES = 1;
-       public static final byte MESSAGES = 2;
-       
-       public SerializedVector vktStruct;
-       private File structFile;
-       private boolean firstCycle;
-       
-       
-       
-       public TwitterDatasStruct(String username)
-       {
-               //tds = tuxdroid datas saved.
-               
-               File path = new File("");
-               structFile = new File( path.getAbsolutePath() + File.separator 
+ username + "@twitter.sav");
-               
-               if(structFile.exists())
-               {
-                       //Getting serialized object struct.
-                       this.firstCycle = false;
-                       vktStruct = this.loadStruct();
-               }
-               else
-               {
-                       this.firstCycle = true;
-                       //Create struct.
-                       vktStruct = new SerializedVector();
-                       if(vktStruct == null)
-                       {
-                               vktStruct = new SerializedVector();
-                       }
-               }
-       }
-       
-       
-       /**
-        * Regiter the structure.
-        */
-       public void registerStruct()
-       {
-               if(this.vktStruct.size() <= 0)
-               {
-                       return;
-               }
-               
-               try 
-               {  
-                   FileOutputStream file = new 
FileOutputStream(this.structFile);  
-                   ObjectOutputStream oos = new ObjectOutputStream(file);  
-                   oos.writeObject(this.vktStruct);  
-                   oos.flush();  
-                   oos.close();  
-                }  
-                catch (java.io.IOException e) 
-                {  
-                     e.printStackTrace();  
-                }  
-       }
-       
-       
-       
-       /**
-        * Load the twitterDatasStruct object.
-        */
-       private SerializedVector loadStruct()
-       {
-               try 
-               {  
-                   FileInputStream fichier = new 
FileInputStream(this.structFile);  
-                   ObjectInputStream ois = new ObjectInputStream(fichier);  
-                   return (SerializedVector) ois.readObject();  
-                }   
-                catch (java.io.IOException e) 
-                {  
-                     e.printStackTrace();  
-                }  
-                catch (ClassNotFoundException e) 
-                {  
-                     e.printStackTrace();  
-                }  
-                return null;
-       }
-       
-       
-       /**
-        * Add a message to the message hashtable.
-        * @param sender
-        * @param message
-        */
-       public void addMessage(String sender, String message)
-       {
-               this.vktStruct.addMessage(sender, message);
-       }
-       
-       
-       /**
-        * Add a reply to the reply hashtable.
-        * @param sender
-        * @param reply
-        */
-       public void addReply(String sender, String reply)
-       {
-               this.vktStruct.addReply(sender, reply);
-       }
-       
-       
-       /**
-        * Add a status for selected friend.
-        * @param friens
-        * @param status
-        */
-       public void addFriendStatus(String friend, String status)
-       {
-               this.vktStruct.addFriendStatus(friend, status);
-       }
-       
-       
-       
-       /**
-        * This function return the state of cycle ( first start or not for the 
current user ).
-        * @return
-        */
-       public boolean isFirstCycle()
-       {
-               return this.firstCycle;
-       }
-       
-       /**
-        * Return true if the target is registered.
-        * @param list
-        * @param sender
-        * @param value
-        * @return
-        */
-       public boolean isRegistered(byte list, String sender, String value)
-       {
-               
-               switch(list)
-               {
-                       case TwitterDatasStruct.FRIENDS_STATUSES:
-                       {
-                               for(int index=0; index < this.vktStruct.size(); 
index ++)
-                               {
-                                       if(this.vktStruct.isFriendStatut(index))
-                                       {
-                                               FriendStatut friendStatus = 
(FriendStatut)this.vktStruct.get(index);
-                                               
if(friendStatus.getFriendName().equals(sender))
-                                               {
-                                                       
if(friendStatus.getFriendStatus().equals(value))
-                                                       {
-                                                               return true;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-                       
-                       case TwitterDatasStruct.MESSAGES:
-                       {
-                               for(int index=0; index < this.vktStruct.size(); 
index ++)
-                               {
-                                       if(this.vktStruct.isMessage(index))
-                                       {
-                                               Message message = (Message) 
this.vktStruct.get(index);
-                                               
if(message.getSender().equals(sender))
-                                               {
-                                                       
if(message.getMessage().equals(value))
-                                                       {
-                                                               return true;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-                       
-                       case TwitterDatasStruct.REPLIES:
-                       {
-                               for(int index=0; index < this.vktStruct.size(); 
index ++)
-                               {
-                                       if(this.vktStruct.isReply(index))
-                                       {
-                                               Reply reply = (Reply) 
this.vktStruct.get(index);
-                                               
if(reply.getSender().equals(sender))
-                                               {
-                                                       
if(reply.getReply().equals(value))
-                                                       {
-                                                               return true;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               }
-               return false;
-       }
+    private static final long serialVersionUID = 8395814134877723558L;
 
+    public static final byte FRIENDS_STATUSES = 0;
+    public static final byte REPLIES = 1;
+    public static final byte MESSAGES = 2;
 
-/**
- * Handle a serialized vector of hashtable typed as <string string>
- * @author nux
- *
- */
-class SerializedVector extends Vector<Object> implements Serializable{
-       
-       private static final long serialVersionUID = 7018170438526763017L;
-       
-       public SerializedVector()
-       {
-               super();
-       }
-       
-       /**
-        * Add a new message in the object.
-        * @param sender
-        * @param message
-        */
-       public void addMessage(String sender, String message)
-       {
-               this.add(new Message(sender, message));
-       }
-       
-       
-       /**
-        * Add a new Reply in the object.
-        * @param sender
-        * @param reply
-        */
-       public void addReply(String sender, String reply)
-       {
-               this.add(new Reply(sender, reply));
-       }
-       
-       
-       /**
-        * Add a new user status in the object.
-        * @param friendName
-        * @param friendStatus
-        */
-       public void addFriendStatus(String friendName, String friendStatus)
-       {
-               this.add(new FriendStatut(friendName, friendStatus));
-       }
-       
-       
-       /**
-        * Return true if object at 'objectIndex' is a message.
-        * @param objectIndex
-        * @return
-        */
-       public boolean isMessage(int objectIndex)
-       {
-               return this.get(objectIndex) instanceof Message;
-       }
-       
-       
-       /**
-        * Return true if the object at 'objectIndex' is a Reply.
-        * @param objectIndex
-        * @return
-        */
-       public boolean isReply(int objectIndex)
-       {
-               return this.get(objectIndex) instanceof Reply;
-       }
-       
-       
-       /**
-        * Return true if the object at 'objectIndex' is a FriendStatut. 
-        * @param objectIndex
-        * @return
-        */
-       public boolean isFriendStatut(int objectIndex)
-       {
-               return this.get(objectIndex) instanceof FriendStatut;
-       }
+    public SerializedVector vktStruct;
+    private File structFile;
+    private boolean firstCycle;
+
+
+
+    public TwitterDatasStruct(String username)
+    {
+        //tds = tuxdroid datas saved.
+
+        File path = new File("");
+        structFile = new File( path.getAbsolutePath() + File.separator + 
username + "@twitter.sav");
+
+        if(structFile.exists())
+        {
+            //Getting serialized object struct.
+            this.firstCycle = false;
+            vktStruct = this.loadStruct();
+        }
+        else
+        {
+            this.firstCycle = true;
+            //Create struct.
+            vktStruct = new SerializedVector();
+            if(vktStruct == null)
+            {
+                vktStruct = new SerializedVector();
+            }
+        }
+    }
+
+
+    /**
+     * Regiter the structure.
+     */
+    public void registerStruct()
+    {
+        if(this.vktStruct.size() <= 0)
+        {
+            return;
+        }
+
+        try
+        {
+            FileOutputStream file = new FileOutputStream(this.structFile);
+            ObjectOutputStream oos = new ObjectOutputStream(file);
+            oos.writeObject(this.vktStruct);
+            oos.flush();
+            oos.close();
+        }
+        catch (java.io.IOException e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+
+
+    /**
+     * Load the twitterDatasStruct object.
+     */
+    private SerializedVector loadStruct()
+    {
+        try
+        {
+            FileInputStream fichier = new FileInputStream(this.structFile);
+            ObjectInputStream ois = new ObjectInputStream(fichier);
+            return (SerializedVector) ois.readObject();
+        }
+        catch (java.io.IOException e)
+        {
+            e.printStackTrace();
+        }
+        catch (ClassNotFoundException e)
+        {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+
+    /**
+     * Add a message to the message hashtable.
+     * @param sender
+     * @param message
+     */
+    public void addMessage(String sender, String message)
+    {
+        this.vktStruct.addMessage(sender, message);
+    }
+
+
+    /**
+     * Add a reply to the reply hashtable.
+     * @param sender
+     * @param reply
+     */
+    public void addReply(String sender, String reply)
+    {
+        this.vktStruct.addReply(sender, reply);
+    }
+
+
+    /**
+     * Add a status for selected friend.
+     * @param friens
+     * @param status
+     */
+    public void addFriendStatus(String friend, String status)
+    {
+        this.vktStruct.addFriendStatus(friend, status);
+    }
+
+
+
+    /**
+     * This function return the state of cycle ( first start or not for the 
current user ).
+     * @return
+     */
+    public boolean isFirstCycle()
+    {
+        return this.firstCycle;
+    }
+
+    /**
+     * Return true if the target is registered.
+     * @param list
+     * @param sender
+     * @param value
+     * @return
+     */
+    public boolean isRegistered(byte list, String sender, String value)
+    {
+
+        switch(list)
+        {
+            case TwitterDatasStruct.FRIENDS_STATUSES:
+                {
+                    for(int index=0; index < this.vktStruct.size(); index ++)
+                    {
+                        if(this.vktStruct.isFriendStatut(index))
+                        {
+                            FriendStatut friendStatus = 
(FriendStatut)this.vktStruct.get(index);
+                            if(friendStatus.getFriendName().equals(sender))
+                            {
+                                
if(friendStatus.getFriendStatus().equals(value))
+                                {
+                                    return true;
+                                }
+                            }
+                        }
+                    }
+                }
+
+            case TwitterDatasStruct.MESSAGES:
+                {
+                    for(int index=0; index < this.vktStruct.size(); index ++)
+                    {
+                        if(this.vktStruct.isMessage(index))
+                        {
+                            Message message = (Message) 
this.vktStruct.get(index);
+                            if(message.getSender().equals(sender))
+                            {
+                                if(message.getMessage().equals(value))
+                                {
+                                    return true;
+                                }
+                            }
+                        }
+                    }
+                }
+
+            case TwitterDatasStruct.REPLIES:
+                {
+                    for(int index=0; index < this.vktStruct.size(); index ++)
+                    {
+                        if(this.vktStruct.isReply(index))
+                        {
+                            Reply reply = (Reply) this.vktStruct.get(index);
+                            if(reply.getSender().equals(sender))
+                            {
+                                if(reply.getReply().equals(value))
+                                {
+                                    return true;
+                                }
+                            }
+                        }
+                    }
+                }
+        }
+        return false;
+    }
+
+
+    /**
+     * Handle a serialized vector of hashtable typed as <string string>
+     * @author nux
+     *
+     */
+    class SerializedVector extends Vector<Object> implements Serializable{
+
+        private static final long serialVersionUID = 7018170438526763017L;
+
+        public SerializedVector()
+        {
+            super();
+        }
+
+        /**
+         * Add a new message in the object.
+         * @param sender
+         * @param message
+         */
+        public void addMessage(String sender, String message)
+        {
+            this.add(new Message(sender, message));
+        }
+
+
+        /**
+         * Add a new Reply in the object.
+         * @param sender
+         * @param reply
+         */
+        public void addReply(String sender, String reply)
+        {
+            this.add(new Reply(sender, reply));
+        }
+
+
+        /**
+         * Add a new user status in the object.
+         * @param friendName
+         * @param friendStatus
+         */
+        public void addFriendStatus(String friendName, String friendStatus)
+        {
+            this.add(new FriendStatut(friendName, friendStatus));
+        }
+
+
+        /**
+         * Return true if object at 'objectIndex' is a message.
+         * @param objectIndex
+         * @return
+         */
+        public boolean isMessage(int objectIndex)
+        {
+            return this.get(objectIndex) instanceof Message;
+        }
+
+
+        /**
+         * Return true if the object at 'objectIndex' is a Reply.
+         * @param objectIndex
+         * @return
+         */
+        public boolean isReply(int objectIndex)
+        {
+            return this.get(objectIndex) instanceof Reply;
+        }
+
+
+        /**
+         * Return true if the object at 'objectIndex' is a FriendStatut.
+         * @param objectIndex
+         * @return
+         */
+        public boolean isFriendStatut(int objectIndex)
+        {
+            return this.get(objectIndex) instanceof FriendStatut;
+        }
+    }
 }
-}


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to