Browse Source

Zap Marker

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271343 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
1b9d7fdf9b
4 changed files with 0 additions and 128 deletions
  1. +0
    -11
      proposal/myrmidon/src/main/org/apache/tools/ant/types/Commandline.java
  2. +0
    -53
      proposal/myrmidon/src/main/org/apache/tools/ant/types/Marker.java
  3. +0
    -11
      proposal/myrmidon/src/todo/org/apache/tools/ant/types/Commandline.java
  4. +0
    -53
      proposal/myrmidon/src/todo/org/apache/tools/ant/types/Marker.java

+ 0
- 11
proposal/myrmidon/src/main/org/apache/tools/ant/types/Commandline.java View File

@@ -147,17 +147,6 @@ public class Commandline
}
}

/**
* Return a marker. <p>
*
* This marker can be used to locate a position on the commandline - to
* insert something for example - when all parameters have been set.</p>
*/
// public Marker createMarker()
// {
// return new Marker( this, m_arguments.size() );
// }

public int size()
{
return getCommandline().length;


+ 0
- 53
proposal/myrmidon/src/main/org/apache/tools/ant/types/Marker.java View File

@@ -1,53 +0,0 @@
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.tools.ant.types;

import java.util.ArrayList;

/**
* Class to keep track of the position of an Argument.
*
* <p>This class is there to support the srcfile and targetfile
* elements of &lt;execon&gt; and &lt;transform&gt; - don't know
* whether there might be additional use cases.</p> --SB
*/
public class Marker
{
private int m_realPos = -1;
private int m_position;
private Commandline m_commandline;

Marker( Commandline commandline, int position )
{
m_commandline = commandline;
m_position = position;
}

/**
* Return the number of arguments that preceeded this marker. <p>
*
* The name of the executable - if set - is counted as the very first
* argument.</p>
*
* @return The Position value
*/
public int getPosition()
{
if( m_realPos == -1 )
{
m_realPos = ( m_commandline.getExecutable() == null ? 0 : 1 );
final ArrayList arguments = m_commandline.m_arguments;
for( int i = 0; i < m_position; i++ )
{
final Argument arg = (Argument)arguments.get( i );
m_realPos += arg.getParts().length;
}
}
return m_realPos;
}
}

+ 0
- 11
proposal/myrmidon/src/todo/org/apache/tools/ant/types/Commandline.java View File

@@ -147,17 +147,6 @@ public class Commandline
}
}

/**
* Return a marker. <p>
*
* This marker can be used to locate a position on the commandline - to
* insert something for example - when all parameters have been set.</p>
*/
// public Marker createMarker()
// {
// return new Marker( this, m_arguments.size() );
// }

public int size()
{
return getCommandline().length;


+ 0
- 53
proposal/myrmidon/src/todo/org/apache/tools/ant/types/Marker.java View File

@@ -1,53 +0,0 @@
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.tools.ant.types;

import java.util.ArrayList;

/**
* Class to keep track of the position of an Argument.
*
* <p>This class is there to support the srcfile and targetfile
* elements of &lt;execon&gt; and &lt;transform&gt; - don't know
* whether there might be additional use cases.</p> --SB
*/
public class Marker
{
private int m_realPos = -1;
private int m_position;
private Commandline m_commandline;

Marker( Commandline commandline, int position )
{
m_commandline = commandline;
m_position = position;
}

/**
* Return the number of arguments that preceeded this marker. <p>
*
* The name of the executable - if set - is counted as the very first
* argument.</p>
*
* @return The Position value
*/
public int getPosition()
{
if( m_realPos == -1 )
{
m_realPos = ( m_commandline.getExecutable() == null ? 0 : 1 );
final ArrayList arguments = m_commandline.m_arguments;
for( int i = 0; i < m_position; i++ )
{
final Argument arg = (Argument)arguments.get( i );
m_realPos += arg.getParts().length;
}
}
return m_realPos;
}
}

Loading…
Cancel
Save