Package app.model
Interface ProgrammingLanguage
public interface ProgrammingLanguage
An interface describing functions required for a class to
provide language specific details and functionality.
-
Method Summary
Modifier and Type Method Description java.lang.String
commentLine(java.lang.String line)
Comment out a linejava.lang.String
commentSelection(java.lang.String selection)
Comment out an area of textjava.lang.String
getName()
java.util.regex.Pattern
getPattern()
java.util.Map<java.util.regex.Pattern,java.lang.String>
getPatternMap()
boolean
isCommentedLine(java.lang.String line)
boolean
isCommentedSelection(java.lang.String selection)
java.lang.String
unCommentLine(java.lang.String line)
Uncomment a linejava.lang.String
unCommentSelection(java.lang.String selection)
Uncomment an area of text
-
Method Details
-
getName
java.lang.String getName()- Returns:
- The name of the programming language
-
getPatternMap
java.util.Map<java.util.regex.Pattern,java.lang.String> getPatternMap()- Returns:
- The map containing the regexes and corresponding style-classes to be used for syntax highlighting
-
getPattern
java.util.regex.Pattern getPattern()- Returns:
- A combined regex for syntax highlighting
-
commentLine
java.lang.String commentLine(java.lang.String line)Comment out a line- Parameters:
line
- The text of the line to comment out- Returns:
- The commented line
-
unCommentLine
java.lang.String unCommentLine(java.lang.String line)Uncomment a line- Parameters:
line
- The text of the line to uncomment- Returns:
- The uncommented line
-
isCommentedLine
boolean isCommentedLine(java.lang.String line)- Parameters:
line
- The text of the line- Returns:
- Whether or not a line is commented
-
commentSelection
java.lang.String commentSelection(java.lang.String selection)Comment out an area of text- Parameters:
selection
- The text of the area to comment out- Returns:
- The commented area
-
unCommentSelection
java.lang.String unCommentSelection(java.lang.String selection)Uncomment an area of text- Parameters:
selection
- The text of the area to uncomment- Returns:
- The uncommented area
-
isCommentedSelection
boolean isCommentedSelection(java.lang.String selection)- Parameters:
selection
- The content of the area- Returns:
- Whether or not an area of text is commented
-