![JAR search and dependency download from the Maven repository](/logo.png)
cz.vutbr.web.csskit.TermPairImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jstyleparser Show documentation
Show all versions of jstyleparser Show documentation
jStyleParser is a CSS parser written in Java. It has its own application interface that is designed to allow an efficient CSS processing in Java and mapping the values to the Java data types. It parses CSS 2.1 style sheets into structures that can be efficiently assigned to DOM elements. It is intended be the primary CSS parser for the CSSBox library. While handling errors, it is user agent conforming according to the CSS specification.
The newest version!
package cz.vutbr.web.csskit;
import cz.vutbr.web.css.TermPair;
public class TermPairImpl extends TermImpl implements TermPair {
protected K key;
protected TermPairImpl() {
}
public K getKey() {
return key;
}
public TermPair setKey(K key) {
this.key = key;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
if(operator != null) sb.append(operator.value());
if(key!=null) sb.append(key);
if(value!=null) {
sb.append(OutputUtil.SPACE_DELIM).append(value);
}
return sb.toString();
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((key == null) ? 0 : key.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (!(obj instanceof TermPairImpl, ?>))
return false;
@SuppressWarnings("unchecked")
TermPairImpl other = (TermPairImpl) obj;
if (key == null) {
if (other.key != null)
return false;
} else if (!key.equals(other.key))
return false;
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy