CADI.Server.LogicalTarget
Class LogicalTargetList

java.lang.Object
  extended by CADI.Server.LogicalTarget.LogicalTargetList

public class LogicalTargetList
extends java.lang.Object

This class implements a list of loaded logical targets. Logicat targets will be loaded and indexed the first time they are requested. Then they are saved to improve the response of the next requests.

NOTICE: Methods are not synchronizced yet. It may be a problem with the threads.

Version:
1.0 2007/10/28
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
private  java.util.ArrayList<ServerLogicalTarget> logicalTargets
          Contains the list of loaded logical targets.
 
Constructor Summary
LogicalTargetList()
          Constructor of LogicalTargetList.
 
Method Summary
 void add(ServerLogicalTarget logicalTarget)
          Appends the specific logical target to the list of logical targets.
 boolean equals(java.lang.String target, java.lang.String tid)
          Check if the logical target identified
 ServerLogicalTarget getByTarget(java.lang.String target)
          Gets a logical target from the list.
 ServerLogicalTarget getByTID(java.lang.String tid)
          Gets a logical target from the list.
 boolean isEmpty()
          Returns true if the list contains no elements.
 void list(java.io.PrintStream out)
          Prints this Logical Target List fields out to the specified output stream.
 int size()
          Returns the number of elements in the list.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logicalTargets

private java.util.ArrayList<ServerLogicalTarget> logicalTargets
Contains the list of loaded logical targets.

Constructor Detail

LogicalTargetList

public LogicalTargetList()
Constructor of LogicalTargetList. It initializes the list to a void list.

Method Detail

add

public void add(ServerLogicalTarget logicalTarget)
Appends the specific logical target to the list of logical targets.

Parameters:
logicalTarget - logical target to be appended to the list.

getByTID

public ServerLogicalTarget getByTID(java.lang.String tid)
Gets a logical target from the list. The logical target is idenfied by the target identifier (tid).

NOTICE: elmentents are not copied. Its reference is passed.

Parameters:
tid - definition in TargetField.target.
Returns:
an object which contains the logical target information. If the tid is not in the list, it returns null

getByTarget

public ServerLogicalTarget getByTarget(java.lang.String target)
Gets a logical target from the list. The logical target is idenfied by the target.

NOTICE: elmentents are not copied. Its reference is returned.

Parameters:
target - definition in TargetField.target.
Returns:
an object which contains the logical target information. If the target is not in the list, it returns null

equals

public boolean equals(java.lang.String target,
                      java.lang.String tid)
Check if the logical target identified

Parameters:
target - definition in TargetField.target.
tid - definition in TargetField.tid.
Returns:
true if the target belongs to the target identifier tid.

isEmpty

public boolean isEmpty()
Returns true if the list contains no elements. Otherwise, returns false.

Returns:
true if the list contains no elements.

size

public int size()
Returns the number of elements in the list.

Returns:
the number of elements in the list.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

list

public void list(java.io.PrintStream out)
Prints this Logical Target List fields out to the specified output stream. This method is useful for debugging.

Parameters:
out - an output stream.


CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Group on Interactive Coding of Images (GICI) (contact)