Package minpq.moderator
Class Moderator
- java.lang.Object
-
- minpq.moderator.Moderator
-
class Moderator extends Object
Simulate a content moderation priority queue with "streaming" data.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
PATH
Path to the toxic content.private static boolean
SAFE_FOR_WORK
Hide the content if true.
-
Constructor Summary
Constructors Constructor Description Moderator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
addComments(ExtrinsicMinPQ<String> pq, Scanner scanner, int n)
Adds up to N comments from the scanner to the priority queue with negated weights.static void
main(String[] args)
-
-
-
Field Detail
-
SAFE_FOR_WORK
private static final boolean SAFE_FOR_WORK
Hide the content if true.- See Also:
- Constant Field Values
-
PATH
private static final String PATH
Path to the toxic content.- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(String[] args) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
addComments
private static void addComments(ExtrinsicMinPQ<String> pq, Scanner scanner, int n)
Adds up to N comments from the scanner to the priority queue with negated weights.- Parameters:
pq
- the destination priority queue.scanner
- the input scanner.n
- the number of comments to read from the scanner.
-
-