Methods Summary |
---|
private int | compare(java.lang.Comparable comparable1, java.lang.Comparable comparable2)
if (null == comparable1) {
if (null == comparable2) {
return 0;
}
return -1; // null is less than non-null
}
if (null == comparable2) {
return 1;
}
return comparable1.compareTo(comparable2);
|
public int | compareTo(java.lang.Object object)
NameAttributeSetPair otherNameAttributePair = (NameAttributeSetPair) object;
int returnValue;
returnValue = compare(_name, otherNameAttributePair.getName());
if (0 != returnValue) {
return returnValue;
}
return compare(_attributes, otherNameAttributePair.getAttributes());
|
public boolean | equals(java.lang.Object object)
if (false == (object instanceof NameAttributeSetPair)) {
return false;
}
NameAttributeSetPair otherNameAttributePair = (NameAttributeSetPair) object;
if (0 != compareTo(otherNameAttributePair.getName())) {
return false;
}
AttributeSet otherAttributes = otherNameAttributePair.getAttributes();
return (0 == compare(_attributes, otherAttributes));
|
protected AttributeSet | getAttributes()
return _attributes;
|
protected java.lang.String | getName()
return _name;
|
public boolean | matchesQueryObject(com.ora.rmibook.chapter15.impl.NameAttributeSetPair query)
String otherName = query.getName();
if ((null != otherName) && (false == otherName.equals(_name))) {
return false;
}
AttributeSet otherAttributes = query.getAttributes();
if (null != otherAttributes) {
return otherAttributes.subsetOf(_attributes);
}
return true;
|