source: java/main/src/main/java/com/framsticks/params/Group.java @ 77

Last change on this file since 77 was 77, checked in by psniegowski, 11 years ago

Add new java codebase.

File size: 734 bytes
Line 
1package com.framsticks.params;
2
3import java.util.ArrayList;
4import java.util.List;
5
6/**
7 * @author Piotr Sniegowski
8 */
9public class Group {
10        String name;
11
12        /**
13         * Group members.
14         */
15        List<Param> params = new ArrayList<Param>();
16
17        public Group(String name) {
18                this.name = name;
19        }
20
21        /**
22         * Adds new group member.
23         *
24         * @param p the new group member
25         */
26        void addProperty(Param p) {
27                params.add(p);
28        }
29
30        /**
31         * Gets the property.
32         *
33         * @param i the i
34         * @return the property
35         */
36        Param getProperty(int i) {
37                if (i < 0 || i >= params.size())
38                        return null;
39                return params.get(i);
40        }
41
42        /*
43                         * (non-Javadoc)
44                         *
45                         * @see java.lang.Object#toString()
46                         */
47        @Override
48        public String toString() {
49                return name;
50        }
51
52}
Note: See TracBrowser for help on using the repository browser.