3 * Copyright 2002-2004 The Ant-Contrib project
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package net
.sf
.antcontrib
.cpptasks
;
18 import java
.util
.Vector
;
22 public final class DependencyInfo
{
24 * Last modified time of this file or anything that it depends on.
26 * Not persisted since almost any change could invalidate it. Initialized
27 * to long.MIN_VALUE on construction.
29 private long compositeLastModified
;
30 private/* final */String includePathIdentifier
;
31 private/* final */String
[] includes
;
32 private/* final */String source
;
33 private/* final */long sourceLastModified
;
34 private/* final */String
[] sysIncludes
;
35 public DependencyInfo(String includePathIdentifier
, String source
,
36 long sourceLastModified
, Vector includes
, Vector sysIncludes
) {
38 throw new NullPointerException("source");
40 if (includePathIdentifier
== null) {
41 throw new NullPointerException("includePathIdentifier");
44 this.sourceLastModified
= sourceLastModified
;
45 this.includePathIdentifier
= includePathIdentifier
;
46 this.includes
= new String
[includes
.size()];
47 if (includes
.size() == 0) {
48 compositeLastModified
= sourceLastModified
;
50 includes
.copyInto(this.includes
);
51 compositeLastModified
= Long
.MIN_VALUE
;
53 this.sysIncludes
= new String
[sysIncludes
.size()];
54 sysIncludes
.copyInto(this.sysIncludes
);
57 * Returns the latest modification date of the source or anything that it
60 * @returns the composite lastModified time, returns Long.MIN_VALUE if not
63 public long getCompositeLastModified() {
64 return compositeLastModified
;
66 public String
getIncludePathIdentifier() {
67 return includePathIdentifier
;
69 public String
[] getIncludes() {
70 String
[] includesClone
= (String
[]) includes
.clone();
73 public String
getSource() {
76 public long getSourceLastModified() {
77 return sourceLastModified
;
79 public String
[] getSysIncludes() {
80 String
[] sysIncludesClone
= (String
[]) sysIncludes
.clone();
81 return sysIncludesClone
;
83 public void setCompositeLastModified(long lastMod
) {
84 compositeLastModified
= lastMod
;