/** * <p> * Add a coordinates to this segment. * Simply add the coordinate to the path list. * </p> * * * * @param coordinates The coordinates to add. It can't be null. * @throws ArgumentNullException If the coordinates is null. */ public void AddCoordinates(TopCoder.Graph.Layout.Coordinates coordinates) { path.Add(coordinates); }
/** * <p> * Remove a coordinates from this segment. * It will remove the first occurrence of coordinates param from the path list. If it doesn't exist in the list, nothing will be done. * Simply delegate to the Remove method of path list. * </p> * * * * @param coordinates The coordinates to remove. It can't be null. * @return true if the coordinates is successfully removed; otherwise, false. This method also returns false if the param is not found in the path list. * @throws ArgumentNullException If the coordinates param is null. */ public bool RemoveCoordinates(TopCoder.Graph.Layout.Coordinates coordinates) { return(path.Remove(coordinates)); }
/** * <p> * Checks whether a coordinates is in the path of this segment. * Simply checks the path list that whether the argument is contained. * </p> * * * * @param coordinates The coordinates to check. Can't be null. * @return whether the coordinates is in the path of this segment. * @throws ArgumentNullException If the coordinates param is null. */ public bool ContainsCoordinates(TopCoder.Graph.Layout.Coordinates coordinates) { return(path.Contains(coordinates));; }
/** * <p> * Insert a coordinates to this segment at the specified position. * Simply insert the coordinate to the specified position of the path list. * Simply delegate to the Insert method of path list. * </p> * * * * @param index The index for the coordinates to insert. It must be in [0, path.Count-1] * @param coordinates The coordinates to insert. It can't be null. * @throws ArgumentNullException If the coordinates is null. * @throws ArgumentOutOfRangeException If index is not in [0, path.Count-1] */ public void InsertCoordinates(int index, TopCoder.Graph.Layout.Coordinates coordinates) { path.Insert(index, coordinates); }