Package app.model.languages
Class Java
java.lang.Object
app.model.languages.Java
- All Implemented Interfaces:
ProgrammingLanguage
public class Java extends java.lang.Object implements ProgrammingLanguage
-
Constructor Summary
Constructors Constructor Description Java() -
Method Summary
Modifier and Type Method Description java.lang.StringcommentLine(java.lang.String line)Comment out a linejava.lang.StringcommentSelection(java.lang.String selection)Comment out an area of textjava.lang.StringgetName()java.util.regex.PatterngetPattern()java.util.Map<java.util.regex.Pattern,java.lang.String>getPatternMap()booleanisCommentedLine(java.lang.String line)booleanisCommentedSelection(java.lang.String selection)java.lang.StringunCommentLine(java.lang.String line)Uncomment a linejava.lang.StringunCommentSelection(java.lang.String selection)Uncomment an area of textMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Java
public Java()
-
-
Method Details
-
getName
public java.lang.String getName()- Specified by:
getNamein interfaceProgrammingLanguage- Returns:
- The name of the programming language
-
getPatternMap
public java.util.Map<java.util.regex.Pattern,java.lang.String> getPatternMap()- Specified by:
getPatternMapin interfaceProgrammingLanguage- Returns:
- The map containing the regexes and corresponding style-classes to be used for syntax highlighting
-
getPattern
public java.util.regex.Pattern getPattern()- Specified by:
getPatternin interfaceProgrammingLanguage- Returns:
- A combined regex for syntax highlighting
-
commentLine
public java.lang.String commentLine(java.lang.String line)Description copied from interface:ProgrammingLanguageComment out a line- Specified by:
commentLinein interfaceProgrammingLanguage- Parameters:
line- The text of the line to comment out- Returns:
- The commented line
-
unCommentLine
public java.lang.String unCommentLine(java.lang.String line)Description copied from interface:ProgrammingLanguageUncomment a line- Specified by:
unCommentLinein interfaceProgrammingLanguage- Parameters:
line- The text of the line to uncomment- Returns:
- The uncommented line
-
isCommentedLine
public boolean isCommentedLine(java.lang.String line)- Specified by:
isCommentedLinein interfaceProgrammingLanguage- Parameters:
line- The text of the line- Returns:
- Whether or not a line is commented
-
commentSelection
public java.lang.String commentSelection(java.lang.String selection)Description copied from interface:ProgrammingLanguageComment out an area of text- Specified by:
commentSelectionin interfaceProgrammingLanguage- Parameters:
selection- The text of the area to comment out- Returns:
- The commented area
-
unCommentSelection
public java.lang.String unCommentSelection(java.lang.String selection)Description copied from interface:ProgrammingLanguageUncomment an area of text- Specified by:
unCommentSelectionin interfaceProgrammingLanguage- Parameters:
selection- The text of the area to uncomment- Returns:
- The uncommented area
-
isCommentedSelection
public boolean isCommentedSelection(java.lang.String selection)- Specified by:
isCommentedSelectionin interfaceProgrammingLanguage- Parameters:
selection- The content of the area- Returns:
- Whether or not an area of text is commented
-