Loading data into a HashMap!

Discussion in 'Plugin Development' started by GeekyCompz, May 10, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    GeekyCompz

    Hello there,
    So I have a plugin so far that sets a start and a finish with coordinates and a world. As well as a KEY NAME.
    When the plugin starts, I need it to create a NEW hashmap and load in all the data from the info specified.
    For example;
    Code:
    P1:
      Start:
        world: world
        x: 100
        y: 60
        z: 100
        yaw: 10.00100
        pitch: 10.00100
    Into a hashmap.
    This is what I have so far, planned. xD
    Code:
    public HashMap<String, List<CourseObject>> courseObj = new HashMap<String, List<CourseObject>>();
    And I have a class called CourseObject.
    How would I go about doing this.

    ~OpenBytes
     
  2. Offline

    justcool393

    Code:java
    1. courseObj.put(String, courseObjectList);


    The String is what I guess is a name and courseObjectList is a thing of the type List<CourseObject>
     
  3. Offline

    GeekyCompz

    I can't get it to work. Any precise code to load the data from the file and put it into it's own map or class.
    Then I could do, this.courseObjs.get... Which I can then get the information of the P1. in the file.

    ~OpenBytes
     
  4. Offline

    coasterman10

    Read up on the configuration API to load data into CourseObject. Then follow the advice of GeekyCompz.
     
Thread Status:
Not open for further replies.

Share This Page