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.String commentLine​(java.lang.String line)
    Comment out a line
    java.lang.String commentSelection​(java.lang.String selection)
    Comment out an area of text
    java.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 line
    java.lang.String unCommentSelection​(java.lang.String selection)
    Uncomment an area of text

    Methods 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:
      getName in interface ProgrammingLanguage
      Returns:
      The name of the programming language
    • getPatternMap

      public java.util.Map<java.util.regex.Pattern,​java.lang.String> getPatternMap()
      Specified by:
      getPatternMap in interface ProgrammingLanguage
      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:
      getPattern in interface ProgrammingLanguage
      Returns:
      A combined regex for syntax highlighting
    • commentLine

      public java.lang.String commentLine​(java.lang.String line)
      Description copied from interface: ProgrammingLanguage
      Comment out a line
      Specified by:
      commentLine in interface ProgrammingLanguage
      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: ProgrammingLanguage
      Uncomment a line
      Specified by:
      unCommentLine in interface ProgrammingLanguage
      Parameters:
      line - The text of the line to uncomment
      Returns:
      The uncommented line
    • isCommentedLine

      public boolean isCommentedLine​(java.lang.String line)
      Specified by:
      isCommentedLine in interface ProgrammingLanguage
      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: ProgrammingLanguage
      Comment out an area of text
      Specified by:
      commentSelection in interface ProgrammingLanguage
      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: ProgrammingLanguage
      Uncomment an area of text
      Specified by:
      unCommentSelection in interface ProgrammingLanguage
      Parameters:
      selection - The text of the area to uncomment
      Returns:
      The uncommented area
    • isCommentedSelection

      public boolean isCommentedSelection​(java.lang.String selection)
      Specified by:
      isCommentedSelection in interface ProgrammingLanguage
      Parameters:
      selection - The content of the area
      Returns:
      Whether or not an area of text is commented