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

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
File size: 992 bytes
RevLine 
[77]1package com.framsticks.params;
2
3import java.util.List;
4
[90]5import javax.annotation.concurrent.Immutable;
6
[87]7import com.framsticks.params.annotations.FramsClassAnnotation;
8import com.framsticks.params.annotations.ParamAnnotation;
[90]9import com.framsticks.util.lang.Containers;
[87]10
[77]11/**
12 * @author Piotr Sniegowski
13 */
[87]14@FramsClassAnnotation
[90]15@Immutable
[77]16public class Group {
17
[87]18        @ParamAnnotation
[90]19        protected final String name;
[87]20
[77]21        /**
22         * Group members.
23         */
[90]24        protected final List<Param> params;
[77]25
[90]26        public Group(GroupBuilder builder) {
27                this.name = builder.getName();
28                this.params = builder.getParams();
[77]29        }
30
31        /**
32         * Gets the property.
33         *
34         * @param i the i
35         * @return the property
36         */
[90]37        public Param getParam(int number) {
38                return Containers.getFromList(params, number, "param", this);
[77]39        }
40
41        @Override
42        public String toString() {
[90]43                return "group" + name;
[77]44        }
45
[87]46        /**
47         * @return the name
48         */
49        @ParamAnnotation
50        public String getName() {
51                return name;
52        }
53
[90]54        public int getCount() {
55                return params.size();
56        }
57
[77]58}
Note: See TracBrowser for help on using the repository browser.