Android Open Source - StudySpaces Study Spaces Data






From Project

Back to project page StudySpaces.

License

The source code is released under:

Apache License

If you think the Android project StudySpaces listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.pennstudyspaces.api;
//from w  ww.  ja v a2  s  . c  om
import java.io.IOException;
import java.util.ArrayList;


public class StudySpacesData {
    private ApiRequest request;
    private Building[] buildingData;
    private RoomKind[] roomKindsData;
    
    public StudySpacesData (ApiRequest request) throws IOException {
        if (request == null)
            throw new IllegalArgumentException("Request cannot be null");
        this.request = request;
        this.buildingData = null;
        this.roomKindsData = null;
        pullData();
    }
    
    private void pullData() throws IOException {
        JsonData jsonData = JsonData.sendRequest(request);
        
        this.buildingData = jsonData.getBuildings().toArray(new Building[1]);

        ArrayList<RoomKind> roomKinds =
                new ArrayList<RoomKind>(getBuildings().length * 5);
        for (Building building : this.buildingData) {
            roomKinds.addAll(building.getRoomKinds());
        }
        
        this.roomKindsData = roomKinds.toArray(new RoomKind[1]);
    }
    
    public ApiRequest getApiRequest() {
        return request;
    }
    
    private Building[] getBuildings() {
        return this.buildingData;
    }
    
    public RoomKind[] getRoomKinds() {
        return this.roomKindsData;
    }
}




Java Source Code List

com.pennstudyspaces.DataListAdapter.java
com.pennstudyspaces.MainActivityDead.java
com.pennstudyspaces.MainActivityTest.java
com.pennstudyspaces.MainActivity.java
com.pennstudyspaces.MyItemizedOverlay.java
com.pennstudyspaces.PrefsActivity.java
com.pennstudyspaces.RoomDetailsActivityTest.java
com.pennstudyspaces.RoomDetailsActivity.java
com.pennstudyspaces.SearchActivityTest.java
com.pennstudyspaces.SearchActivity.java
com.pennstudyspaces.StudySpacesApplication.java
com.pennstudyspaces.api.ApiRequest.java
com.pennstudyspaces.api.Availability.java
com.pennstudyspaces.api.Building.java
com.pennstudyspaces.api.DataDumpRequest.java
com.pennstudyspaces.api.JsonData.java
com.pennstudyspaces.api.ParamsRequest.java
com.pennstudyspaces.api.RoomKind.java
com.pennstudyspaces.api.Room.java
com.pennstudyspaces.api.StudySpacesData.java