Let the total amount of students in the class be \(s\).
Note that \({5 \over 9}\)th of the students will get 4 sweets, \({1 \over 3} \times (1 -{5 \over 9}) = {4 \over 27}\)th of the students will get 3 sweets, and \({8 \over 27}\)th of the students will get 2 sweets.
From this, we can form the equation: \(({5 \over 9}s \times 4) + ({4 \over 27}s \times 3) + ({8 \over 27}s \times 2) = 264\).
Simplifying, we get: \({88 \over 27}s = 264\), meaning there were originally \(\color{brown}\boxed{81}\) students.