org.cpsolver.coursett.model

## Class StudentGroup

- java.lang.Object
- - org.cpsolver.coursett.model.StudentGroup

- All Implemented Interfaces:
    Comparable<StudentGroup>

      public class StudentGroup
      extends Object
      implements Comparable<StudentGroup>

  Student group.
  Version:
    CourseTT 1.3 (University Course Timetabling)
    Copyright (C) 2006 - 2016 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StudentGroup(long id, double weight, String name)` Create a student group

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addStudent(Student student)` Add student to this group
    `int` | `compareTo(StudentGroup g)`
    `int` | `countOfferings()` Count offerings that students of this group have
    `int` | `countStudents(Long offeringId)` Count students of this group that are requesting the given offering.
    `boolean` | `equals(Object o)`
    `double` | `getAverageEnrollmentWeight(Long offeringId)` Average enrollment weight of students of this group in the given offering
    `long` | `getId()` Returns student group id
    `String` | `getName()` Returns student group name
    `List<Student>` | `getStudents()` Return students of this group
    `double` | `getWeight()` Returns student group weight
    `int` | `hashCode()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### StudentGroup

          public StudentGroup(long id,
                              double weight,
                              String name)

      Create a student group
      Parameters:
        `id` - group unique id
        `weight` - group weight
        `name` - group name

  - ### Method Detail

    - #### getId

          public long getId()

      Returns student group id

    - #### getName

          public String getName()

      Returns student group name

    - #### getWeight

          public double getWeight()

      Returns student group weight

    - #### getStudents

          public List<Student> getStudents()

      Return students of this group

    - #### countStudents

          public int countStudents(Long offeringId)

      Count students of this group that are requesting the given offering.
      Parameters:
        `offeringId` - offering id
      Returns:
        students with `Student.hasOffering(Long)` true

    - #### addStudent

          public void addStudent(Student student)

      Add student to this group
      Parameters:
        `student` - a student to add

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### compareTo

          public int compareTo(StudentGroup g)

      Specified by:
        `compareTo` in interface `Comparable<StudentGroup>`

    - #### getAverageEnrollmentWeight

          public double getAverageEnrollmentWeight(Long offeringId)

      Average enrollment weight of students of this group in the given offering

    - #### countOfferings

          public int countOfferings()

      Count offerings that students of this group have