Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * This file is part of the DiffX library.
  *
  * For licensing information please see the file license.txt included in the release.
  * A copy of this licence can also be found at
  *   http://www.opensource.org/licenses/artistic-license-2.0.php
  */
 package com.topologi.diffx.event.impl;
 
Event corresponding to a single character.

Author(s):
Christophe Lauret
Version:
28 March 2010
public final class CharEvent extends DiffXEventBase {

  
The character associated with this event.
  public final char c;

  
Creates a new character event.

Parameters:
c The character to wrap.
  public CharEvent(char c) {
    this. = c;
  }
  public int hashCode() {
    return 79 + this.;
  }
  public boolean equals(DiffXEvent e) {
    if (e.getClass() != this.getClass()) return false;
    return this. == ((CharEvent)e).;
  }
  public String toString() {
    return "char: '"+this.+'\'';
  }
  public void toXML(XMLWriter xmlthrows IOException {
    xml.writeText(this.);
  }
  public StringBuffer toXML(StringBuffer xmlthrows NullPointerException {
    // TODO: ridiculously inefficient !
    return xml.append(.toElementText(new char[]{this.}, 0, 1));
  }
New to GrepCode? Check out our FAQ X