/** * Returns a GeneralizedCounter conditioned on the given top level object. * This is just shorthand (and more efficient) for <code>conditionalize(new Object[] { o })</code>. */ public GeneralizedCounter<K> conditionalizeOnce(K o) { if (depth() < 1) { throw new RuntimeException("Error -- attempted to conditionalize a GeneralizedCounter of depth " + depth()); } else { return conditionalizeHelper(o); } }
/** * returns a GeneralizedCounter conditioned on the objects in the * {@link List} argument. The length of the argument {@link List} * must be less than the depth of the GeneralizedCounter. */ public GeneralizedCounter<K> conditionalize(List<K> l) { int n = l.size(); if (n >= depth()) { throw new RuntimeException("Error -- attempted to conditionalize a GeneralizedCounter of depth " + depth() + " on a vector of length " + n); } else { GeneralizedCounter<K> next = this; for (K o: l) { next = next.conditionalizeHelper(o); } return next; } }
/** * returns the total count of objects in the GeneralizedCounter. */ public double totalCount() { if (depth() == 1) { return total; // I think this one is always OK. Not very principled here, though. } else { double result = 0.0; for (K o: topLevelKeySet()) { result += conditionalizeOnce(o).totalCount(); } return result; } }
/** * Returns a GeneralizedCounter conditioned on the given top level object. * This is just shorthand (and more efficient) for <code>conditionalize(new Object[] { o })</code>. */ public GeneralizedCounter<K> conditionalizeOnce(K o) { if (depth() < 1) { throw new RuntimeException("Error -- attempted to conditionalize a GeneralizedCounter of depth " + depth()); } else { return conditionalizeHelper(o); } }
/** * Returns a GeneralizedCounter conditioned on the given top level object. * This is just shorthand (and more efficient) for <code>conditionalize(new Object[] { o })</code>. */ public GeneralizedCounter<K> conditionalizeOnce(K o) { if (depth() < 1) { throw new RuntimeException("Error -- attempted to conditionalize a GeneralizedCounter of depth " + depth()); } else { return conditionalizeHelper(o); } }
/** * Returns a GeneralizedCounter conditioned on the given top level object. * This is just shorthand (and more efficient) for <code>conditionalize(new Object[] { o })</code>. */ public GeneralizedCounter<K> conditionalizeOnce(K o) { if (depth() < 1) { throw new RuntimeException("Error -- attempted to conditionalize a GeneralizedCounter of depth " + depth()); } else { return conditionalizeHelper(o); } }
/** * Returns a GeneralizedCounter conditioned on the given top level object. * This is just shorthand (and more efficient) for <code>conditionalize(new Object[] { o })</code>. */ public GeneralizedCounter<K> conditionalizeOnce(K o) { if (depth() < 1) { throw new RuntimeException("Error -- attempted to conditionalize a GeneralizedCounter of depth " + depth()); } else { return conditionalizeHelper(o); } }
/** * returns a GeneralizedCounter conditioned on the objects in the * {@link List} argument. The length of the argument {@link List} * must be less than the depth of the GeneralizedCounter. */ public GeneralizedCounter<K> conditionalize(List<K> l) { int n = l.size(); if (n >= depth()) { throw new RuntimeException("Error -- attempted to conditionalize a GeneralizedCounter of depth " + depth() + " on a vector of length " + n); } else { GeneralizedCounter<K> next = this; for (K o: l) { next = next.conditionalizeHelper(o); } return next; } }
/** * returns a GeneralizedCounter conditioned on the objects in the * {@link List} argument. The length of the argument {@link List} * must be less than the depth of the GeneralizedCounter. */ public GeneralizedCounter<K> conditionalize(List<K> l) { int n = l.size(); if (n >= depth()) { throw new RuntimeException("Error -- attempted to conditionalize a GeneralizedCounter of depth " + depth() + " on a vector of length " + n); } else { GeneralizedCounter<K> next = this; for (K o: l) { next = next.conditionalizeHelper(o); } return next; } }
/** * returns a GeneralizedCounter conditioned on the objects in the * {@link List} argument. The length of the argument {@link List} * must be less than the depth of the GeneralizedCounter. */ public GeneralizedCounter<K> conditionalize(List<K> l) { int n = l.size(); if (n >= depth()) { throw new RuntimeException("Error -- attempted to conditionalize a GeneralizedCounter of depth " + depth() + " on a vector of length " + n); } else { GeneralizedCounter<K> next = this; for (K o: l) { next = next.conditionalizeHelper(o); } return next; } }
/** * returns a GeneralizedCounter conditioned on the objects in the * {@link List} argument. The length of the argument {@link List} * must be less than the depth of the GeneralizedCounter. */ public GeneralizedCounter<K> conditionalize(List<K> l) { int n = l.size(); if (n >= depth()) { throw new RuntimeException("Error -- attempted to conditionalize a GeneralizedCounter of depth " + depth() + " on a vector of length " + n); } else { GeneralizedCounter<K> next = this; for (K o: l) { next = next.conditionalizeHelper(o); } return next; } }
/** * returns the total count of objects in the GeneralizedCounter. */ public double totalCount() { if (depth() == 1) { return total; // I think this one is always OK. Not very principled here, though. } else { double result = 0.0; for (K o: topLevelKeySet()) { result += conditionalizeOnce(o).totalCount(); } return result; } }
/** * returns the total count of objects in the GeneralizedCounter. */ public double totalCount() { if (depth() == 1) { return total; // I think this one is always OK. Not very principled here, though. } else { double result = 0.0; for (K o: topLevelKeySet()) { result += conditionalizeOnce(o).totalCount(); } return result; } }
/** * returns the total count of objects in the GeneralizedCounter. */ public double totalCount() { if (depth() == 1) { return total; // I think this one is always OK. Not very principled here, though. } else { double result = 0.0; for (K o: topLevelKeySet()) { result += conditionalizeOnce(o).totalCount(); } return result; } }
/** * returns the total count of objects in the GeneralizedCounter. */ public double totalCount() { if (depth() == 1) { return total; // I think this one is always OK. Not very principled here, though. } else { double result = 0.0; for (K o: topLevelKeySet()) { result += conditionalizeOnce(o).totalCount(); } return result; } }