From 1e81bfc705cafe88b804a8a6b1b8616c8773d280 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sun, 14 Oct 2007 05:44:35 +0000 Subject: Support ordering by derived properties. --- .../com/amazon/carbonado/info/ChainedProperty.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/main/java/com/amazon/carbonado/info') 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 @@ -183,6 +183,26 @@ public class ChainedProperty implements Appender { return false; } + /** + * 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. -- cgit v1.2.3