diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2007-10-14 05:44:35 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2007-10-14 05:44:35 +0000 |
commit | 1e81bfc705cafe88b804a8a6b1b8616c8773d280 (patch) | |
tree | 01266dc8995a350f6681997173205c59857f6abb /src/main/java/com/amazon/carbonado/info | |
parent | a2b87f48775ca6687de0eb4af4b846bd1f0cdebf (diff) |
Support ordering by derived properties.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/info')
-rw-r--r-- | src/main/java/com/amazon/carbonado/info/ChainedProperty.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/info/ChainedProperty.java b/src/main/java/com/amazon/carbonado/info/ChainedProperty.java index 575bcbf..e067350 100644 --- a/src/main/java/com/amazon/carbonado/info/ChainedProperty.java +++ b/src/main/java/com/amazon/carbonado/info/ChainedProperty.java @@ -184,6 +184,26 @@ public class ChainedProperty<S extends Storable> implements Appender { }
/**
+ * Returns true if any property in the chain is derived.
+ *
+ * @see com.amazon.carbonado.Derived
+ * @since 1.2
+ */
+ public boolean isDerived() {
+ if (mPrime.isDerived()) {
+ return true;
+ }
+ if (mChain != null) {
+ for (StorableProperty<?> prop : mChain) {
+ if (prop.isDerived()) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
* Returns the last property in the chain, or the prime property if chain
* is empty.
*/
|