Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 28704 invoked from network); 14 Mar 2005 13:51:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Mar 2005 13:51:22 -0000 Received: (qmail 41035 invoked by uid 500); 14 Mar 2005 13:51:13 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 40957 invoked by uid 500); 14 Mar 2005 13:51:13 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 40914 invoked by uid 500); 14 Mar 2005 13:51:12 -0000 Received: (qmail 40889 invoked by uid 99); 14 Mar 2005 13:51:12 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 14 Mar 2005 05:51:12 -0800 Received: (qmail 28578 invoked by uid 1539); 14 Mar 2005 13:51:10 -0000 Date: 14 Mar 2005 13:51:10 -0000 Message-ID: <20050314135110.28577.qmail@minotaur.apache.org> From: peterreilly@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs WaitFor.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N peterreilly 2005/03/14 05:51:10 Modified: src/main/org/apache/tools/ant/taskdefs WaitFor.java Log: javadoc + upcase constants Revision Changes Path 1.24 +18 -4 ant/src/main/org/apache/tools/ant/taskdefs/WaitFor.java Index: WaitFor.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/WaitFor.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- WaitFor.java 9 Mar 2004 16:48:06 -0000 1.23 +++ WaitFor.java 14 Mar 2005 13:51:10 -0000 1.24 @@ -1,5 +1,5 @@ /* - * Copyright 2001-2004 The Apache Software Foundation + * Copyright 2001-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,8 @@ private String timeoutProperty; /** - * Set the maximum length of time to wait + * Set the maximum length of time to wait. + * @param time a long value */ public void setMaxWait(long time) { maxWaitMillis = time; @@ -64,6 +65,7 @@ /** * Set the max wait time unit + * @param unit an enumerated Unit value */ public void setMaxWaitUnit(Unit unit) { maxWaitMultiplier = unit.getMultiplier(); @@ -71,6 +73,7 @@ /** * Set the time between each check + * @param time a long value */ public void setCheckEvery(long time) { checkEveryMillis = time; @@ -78,6 +81,7 @@ /** * Set the check every time unit + * @param unit an enumerated Unit value */ public void setCheckEveryUnit(Unit unit) { checkEveryMultiplier = unit.getMultiplier(); @@ -85,6 +89,7 @@ /** * Name the property to set after a timeout. + * @param p the property name */ public void setTimeoutProperty(String p) { timeoutProperty = p; @@ -93,6 +98,7 @@ /** * Check repeatedly for the specified conditions until they become * true or the timeout expires. + * @throws BuildException on error */ public void execute() throws BuildException { if (countConditions() > 1) { @@ -147,12 +153,13 @@ private static final String DAY = "day"; private static final String WEEK = "week"; - private static final String[] units = { + private static final String[] UNITS = { MILLISECOND, SECOND, MINUTE, HOUR, DAY, WEEK }; private Hashtable timeTable = new Hashtable(); + /** Constructor the Unit enumerated type. */ public Unit() { timeTable.put(MILLISECOND, new Long(1L)); timeTable.put(SECOND, new Long(1000L)); @@ -162,14 +169,21 @@ timeTable.put(WEEK, new Long(1000L * 60L * 60L * 24L * 7L)); } + /** + * Convert the value to a multipler (millisecond to unit). + * @return a multipler (a long value) + */ public long getMultiplier() { String key = getValue().toLowerCase(); Long l = (Long) timeTable.get(key); return l.longValue(); } + /** + * @see EnumeratedAttribute#getValues() + */ public String[] getValues() { - return units; + return UNITS; } } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org