Package memely
Class Commands
java.lang.Object
memely.Commands
public class Commands extends Object
String-based commands provided by the meme generation system.
PS3 instructions: this is a required class. You MUST NOT change its name or package or the names or type signatures of existing methods. You MUST NOT add fields, constructors, or instance methods. You may, however, add additional static methods, or strengthen the specs of existing methods.
-
Method Summary
Modifier and Type Method Description static Expression
flip(Expression expression, FlipDirection direction)
Flip an image expression horizontally or vertically.static BufferedImage
image(Expression expression)
Generate the meme of an expression.static String
size(Expression expression)
Compute the size of an image expression.
-
Method Details
-
size
Compute the size of an image expression.- Parameters:
expression
- the meme expression to use- Returns:
- "WxH" (in the same syntax as the corresponding part of the @ resize operator) representing the width W and height H of the image generated by the expression, according to the language definition in the PS3 handout
- Throws:
IOException
- if any of the filenames used in the expression can't be read as images
-
flip
Flip an image expression horizontally or vertically.- Parameters:
expression
- the meme expression to flipdirection
- the direction to flip- Returns:
- a valid expression representing `expression` flipped in `direction`, as described in the PS3 handout
-
image
Generate the meme of an expression.- Parameters:
expression
- the expression to generate- Returns:
- the image generated by the expression, according to the language definition in the PS3 handout
- Throws:
IOException
- if any of the filenames used in the expression can't be read as images
-