Methods Summary |
---|
public int | get(int index)Return the component at specified index.
return components[ index ];
|
public int | getSize()Return number of components in DeweyDecimal .
return components.length;
|
public boolean | isEqual(org.apache.tools.ant.util.DeweyDecimal other)Return true if this DeweyDecimal is
equal to the other DeweyDecimal .
final int max = Math.max(other.components.length, components.length);
for (int i = 0; i < max; i++) {
final int component1 = (i < components.length) ? components[ i ] : 0;
final int component2 = (i < other.components.length) ? other.components[ i ] : 0;
if (component2 != component1) {
return false;
}
}
return true; // Exact match
|
public boolean | isGreaterThan(org.apache.tools.ant.util.DeweyDecimal other)Return true if this DeweyDecimal is
greater than the other DeweyDecimal .
final int max = Math.max(other.components.length, components.length);
for (int i = 0; i < max; i++) {
final int component1 = (i < components.length) ? components[ i ] : 0;
final int component2 = (i < other.components.length) ? other.components[ i ] : 0;
if (component2 > component1) {
return false;
}
if (component2 < component1) {
return true;
}
}
return false; // Exact match
|
public boolean | isGreaterThanOrEqual(org.apache.tools.ant.util.DeweyDecimal other)Return true if this DeweyDecimal is
greater than or equal to the other DeweyDecimal .
final int max = Math.max(other.components.length, components.length);
for (int i = 0; i < max; i++) {
final int component1 = (i < components.length) ? components[ i ] : 0;
final int component2 = (i < other.components.length) ? other.components[ i ] : 0;
if (component2 > component1) {
return false;
}
if (component2 < component1) {
return true;
}
}
return true; // Exact match
|
public boolean | isLessThan(org.apache.tools.ant.util.DeweyDecimal other)Return true if this DeweyDecimal is
less than the other DeweyDecimal .
return !isGreaterThanOrEqual(other);
|
public boolean | isLessThanOrEqual(org.apache.tools.ant.util.DeweyDecimal other)Return true if this DeweyDecimal is
less than or equal to the other DeweyDecimal .
return !isGreaterThan(other);
|
public java.lang.String | toString()Return string representation of DeweyDecimal .
final StringBuffer sb = new StringBuffer();
for (int i = 0; i < components.length; i++) {
if (i != 0) {
sb.append('.");
}
sb.append(components[ i ]);
}
return sb.toString();
|