fbnewsitemdata.java

来自「Sony Ericsson手机上的Facebook客户端全套代码」· Java 代码 · 共 325 行

JAVA
325
字号
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   FbNewsItemData.java

package com.sonyericsson.fb.api.data;

import com.sonyericsson.fb.utils.Logger;
import java.util.Enumeration;
import java.util.Hashtable;

// Referenced classes of package com.sonyericsson.fb.api.data:
//            FbItemData

public class FbNewsItemData extends FbItemData
{

    public FbNewsItemData(Hashtable information)
    {
        _type = 0;
        _information.put("text", "");
        _information.put("href", "");
        _information.put("icon", "");
        Object key;
        Object value;
        for(Enumeration keys = information.keys(); keys.hasMoreElements(); _information.put(key, value))
        {
            key = keys.nextElement();
            value = information.get(key);
        }

        try
        {
            _type = Integer.parseInt((String)_information.get("type"));
        }
        catch(NumberFormatException exception)
        {
            Logger.printErrorln("FbNewsItem.<init>(): Could not parse type information from data.");
        }
        try
        {
            _timeStamp = Long.parseLong((String)_information.get("time"));
        }
        catch(NumberFormatException exception)
        {
            Logger.printErrorln("FbNewsItem.<init>(): Could not parse time information.");
        }
    }

    public int getType()
    {
        return _type;
    }

    public String getText()
    {
        return (String)_information.get("text");
    }

    public String getHref()
    {
        return (String)_information.get("href");
    }

    public String getIconUrl()
    {
        return (String)_information.get("icon");
    }

    public String toString()
    {
        StringBuffer result = new StringBuffer("[NewsItem {\n");
        result.append("\tType=" + getNewsTypeString(_type) + ",\n");
        result.append("\tText=" + getText() + ",\n");
        result.append("\tHref=" + getHref() + ",\n");
        result.append("\tIcon=" + getIconUrl() + ",\n");
        result.append("\tTime=" + getTimeStamp() + "}]");
        return result.toString();
    }

    public static String getNewsTypeString(int type)
    {
        String result = "";
        switch(type)
        {
        case 0: // '\0'
            result = "UnknownStory(0)";
            break;

        case 1: // '\001'
            result = "AddAffiliationStory(1)";
            break;

        case 2: // '\002'
            result = "AddInterestStory(2)";
            break;

        case 5: // '\005'
            result = "AddPhotoToEventStory(5)";
            break;

        case 6: // '\006'
            result = "AddPhotoToGroupStory(6)";
            break;

        case 8: // '\b'
            result = "ApproveFriendStory(8)";
            break;

        case 9: // '\t'
            result = "ApproveRelationshipStory(9)";
            break;

        case 11: // '\013'
            result = "CreateGroupStory(11)";
            break;

        case 12: // '\f'
            result = "CreateEventStory(12)";
            break;

        case 13: // '\r'
            result = "CreatePhotoAlbumStory(13)";
            break;

        case 21: // '\025'
            result = "JoinGroupStory(21)";
            break;

        case 22: // '\026'
            result = "LeaveGroupStory(22)";
            break;

        case 32: // ' '
            result = "RemoveInterestStory(32)";
            break;

        case 33: // '!'
            result = "RemoveRelationshipStory(33)";
            break;

        case 38: // '&'
            result = "RsvpYesEventStory(38)";
            break;

        case 46: // '.'
            result = "UpdateProfileStatusStory(46)";
            break;

        case 56: // '8'
            result = "WallPostUserStory(56)";
            break;

        case 60: // '<'
            result = "ChangeProfilePictureStory(60)";
            break;

        case 62: // '>'
            result = "ChangeRelationshipStatusStory(62)";
            break;

        case 63: // '?'
            result = "UpdateProfileStory(63)";
            break;

        case 64: // '@'
            result = "UploadMobilePhotoStory(64)";
            break;

        case 65: // 'A'
            result = "TaggedInPhotoStory(65)";
            break;

        case 66: // 'B'
            result = "CreateNoteStory(66)";
            break;

        case 68: // 'D'
            result = "TaggedInNoteStory(68)";
            break;

        case 79: // 'O'
            result = "SaveAlbumStory(79)";
            break;

        case 81: // 'Q'
            result = "SaveNoteStory(81)";
            break;

        case 82: // 'R'
            result = "SavePhotoStory(82)";
            break;

        case 83: // 'S'
            result = "SaveProfileStory(83)";
            break;

        case 87: // 'W'
            result = "WallPostNoteStory(87)";
            break;

        case 92: // '\\'
            result = "SaveGroupStory(92)";
            break;

        case 94: // '^'
            result = "SaveEventStory(94)";
            break;

        case 101: // 'e'
            result = "PhotoCommentStory(101)";
            break;

        case 3: // '\003'
        case 4: // '\004'
        case 7: // '\007'
        case 10: // '\n'
        case 14: // '\016'
        case 15: // '\017'
        case 16: // '\020'
        case 17: // '\021'
        case 18: // '\022'
        case 19: // '\023'
        case 20: // '\024'
        case 23: // '\027'
        case 24: // '\030'
        case 25: // '\031'
        case 26: // '\032'
        case 27: // '\033'
        case 28: // '\034'
        case 29: // '\035'
        case 30: // '\036'
        case 31: // '\037'
        case 34: // '"'
        case 35: // '#'
        case 36: // '$'
        case 37: // '%'
        case 39: // '\''
        case 40: // '('
        case 41: // ')'
        case 42: // '*'
        case 43: // '+'
        case 44: // ','
        case 45: // '-'
        case 47: // '/'
        case 48: // '0'
        case 49: // '1'
        case 50: // '2'
        case 51: // '3'
        case 52: // '4'
        case 53: // '5'
        case 54: // '6'
        case 55: // '7'
        case 57: // '9'
        case 58: // ':'
        case 59: // ';'
        case 61: // '='
        case 67: // 'C'
        case 69: // 'E'
        case 70: // 'F'
        case 71: // 'G'
        case 72: // 'H'
        case 73: // 'I'
        case 74: // 'J'
        case 75: // 'K'
        case 76: // 'L'
        case 77: // 'M'
        case 78: // 'N'
        case 80: // 'P'
        case 84: // 'T'
        case 85: // 'U'
        case 86: // 'V'
        case 88: // 'X'
        case 89: // 'Y'
        case 90: // 'Z'
        case 91: // '['
        case 93: // ']'
        case 95: // '_'
        case 96: // '`'
        case 97: // 'a'
        case 98: // 'b'
        case 99: // 'c'
        case 100: // 'd'
        default:
            result = "Unknown value";
            break;
        }
        return result;
    }

    public static final int FB_NEWS_ITEM_UNKNOWN_STORY = 0;
    public static final int FB_NEWS_ITEM_ADD_AFFILIATION_STORY = 1;
    public static final int FB_NEWS_ITEM_ADD_INTEREST_STORY = 2;
    public static final int FB_NEWS_ITEM_ADD_PHOTO_TO_EVENT_STORY = 5;
    public static final int FB_NEWS_ITEM_ADD_PHOTO_TO_GROUP_STORY = 6;
    public static final int FB_NEWS_ITEM_APPROVE_FRIEND_STORY = 8;
    public static final int FB_NEWS_ITEM_APPROVE_RELATIONSHIP_STORY = 9;
    public static final int FB_NEWS_ITEM_CREATE_GROUP_STORY = 11;
    public static final int FB_NEWS_ITEM_CREATE_EVENT_STORY = 12;
    public static final int FB_NEWS_ITEM_CREATE_PHOTO_ALBUM_STORY = 13;
    public static final int FB_NEWS_ITEM_JOIN_GROUP_STORY = 21;
    public static final int FB_NEWS_ITEM_LEAVE_GROUP_STORY = 22;
    public static final int FB_NEWS_ITEM_REMOVE_INTEREST_STORY = 32;
    public static final int FB_NEWS_ITEM_REMOVE_RELATIONSHIP_STORY = 33;
    public static final int FB_NEWS_ITEM_RSVP_YES_EVENT_STORY_STORY = 38;
    public static final int FB_NEWS_ITEM_UPDATE_PROFILE_STATUS_STORY = 46;
    public static final int FB_NEWS_ITEM_WALL_POST_USER_STORY = 56;
    public static final int FB_NEWS_ITEM_CHANGE_PROFILE_PICTURE_STORY = 60;
    public static final int FB_NEWS_ITEM_CHANGE_RELATIONSHIP_STATUS_STORY = 62;
    public static final int FB_NEWS_ITEM_UPDATE_PROFILE_STORY = 63;
    public static final int FB_NEWS_ITEM_UPLOAD_MOBILE_PHOTO_STORY = 64;
    public static final int FB_NEWS_ITEM_TAGGED_IN_PHOTO_STORY = 65;
    public static final int FB_NEWS_ITEM_CREATE_NOTE_STORY = 66;
    public static final int FB_NEWS_ITEM_TAGGED_IN_NOTE_STORY = 68;
    public static final int FB_NEWS_ITEM_SAVE_ALBUM_STORY = 79;
    public static final int FB_NEWS_ITEM_SAVE_NOTE_STORY = 81;
    public static final int FB_NEWS_ITEM_SAVE_PHOTO_STORY = 82;
    public static final int FB_NEWS_ITEM_SAVE_PROFILE_STORY = 83;
    public static final int FB_NEWS_ITEM_WALL_POST_NOTE_STORY = 87;
    public static final int FB_NEWS_ITEM_SAVE_GROUP_STORY = 92;
    public static final int FB_NEWS_ITEM_SAVE_EVENT_STORY = 94;
    public static final int FB_NEWS_ITEM_PHOTO_COMMENT_STORY = 101;
    private int _type;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?