Пример #1
0
int JComplex::compareTo(const JObject& s) const {
  if (className() != s.className()) 
    return JObject::compareTo(s);
  return cmp(value.norm(), ((JComplex*)&s)->value.norm());
}
Пример #2
0
int JRandom::compareTo(const JObject& s) const {
  if (className() != s.className())
    return JObject::compareTo(s);
  return seed - ((JRandom*)&s)->seed;
}
Пример #3
0
int JColor::compareTo(const JObject& s) const {
  if (className() != s.className())
    return JObject::compareTo(s);
  return value - (*(JColor*)&s).value;
}
Пример #4
0
int JPObject::compareTo(const JObject& s) const {
  if (className() != s.className()) return false;
  return obj-((JPObject*)&s)->obj;
}