Ejemplo n.º 1
0
 @Override
 public int hashCode() {
   int result = characters.hashCode();
   result = 31 * result + color.hashCode();
   result = 31 * result + style.hashCode();
   return result;
 }
Ejemplo n.º 2
0
  public boolean equalsIgnoreCharacter(TerminalString that) {
    if (style != that.style) return false;
    if (ignoreRendering != that.ignoreRendering) return false;
    if (!color.equals(that.color)) return false;

    return true;
  }
Ejemplo n.º 3
0
 public int getANSILength() {
   if (ignoreRendering) return 0;
   else {
     if (ansiLength == 0)
       ansiLength =
           ANSI.getStart().length()
               + color.getLength()
               + style.getLength()
               + ANSI.reset().length()
               + 2; // ; + m
     return ansiLength;
   }
 }
Ejemplo n.º 4
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof TerminalString)) return false;

    TerminalString that = (TerminalString) o;

    if (ignoreRendering) {
      return characters.equals(that.characters);
    }

    if (!characters.equals(that.characters)) return false;
    if (!color.equals(that.color)) return false;
    if (style != that.style) return false;

    return true;
  }