public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Fold Id into TaskId. Date: Wed, 27 Feb 2008 21:19:00 -0000 [thread overview] Message-ID: <20080227211945.22462.qmail@sourceware.org> (raw) The branch, master has been updated via 85b7a239f83c060989244bb0d234db0afe059a05 (commit) from f0bc57dd50f9c00eddfc9b054fd9e5f2e717de36 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 85b7a239f83c060989244bb0d234db0afe059a05 Author: Andrew Cagney <cagney@redhat.com> Date: Wed Feb 27 16:18:40 2008 -0500 Fold Id into TaskId. frysk-core/frysk/proc/ChangeLog 2008-02-27 Andrew Cagney <cagney@redhat.com> * Id.java: Delete. * TaskId.java: Update. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/proc/ChangeLog | 3 + frysk-core/frysk/proc/Id.java | 111 ------------------------------------- frysk-core/frysk/proc/TaskId.java | 62 ++++++++++++++------- 3 files changed, 44 insertions(+), 132 deletions(-) delete mode 100644 frysk-core/frysk/proc/Id.java First 500 lines of diff: diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog index 863fd83..6ee5f3e 100644 --- a/frysk-core/frysk/proc/ChangeLog +++ b/frysk-core/frysk/proc/ChangeLog @@ -1,5 +1,8 @@ 2008-02-27 Andrew Cagney <cagney@redhat.com> + * Id.java: Delete. + * TaskId.java: Update. + * ProcEvent.java (getProcFromTaskId()): Delete. * Host.java (get(TaskId)): Delete. * Proc.java (getMainTask()): Use taskPool, not Host. diff --git a/frysk-core/frysk/proc/Id.java b/frysk-core/frysk/proc/Id.java deleted file mode 100644 index f96ec9b..0000000 --- a/frysk-core/frysk/proc/Id.java +++ /dev/null @@ -1,111 +0,0 @@ -// This file is part of the program FRYSK. -// -// Copyright 2005, 2006, 2007, Red Hat Inc. -// -// FRYSK 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; version 2 of the License. -// -// FRYSK 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. -// -// You should have received a copy of the GNU General Public License -// along with FRYSK; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -// -// In addition, as a special exception, Red Hat, Inc. gives You the -// additional right to link the code of FRYSK with code not covered -// under the GNU General Public License ("Non-GPL Code") and to -// distribute linked combinations including the two, subject to the -// limitations in this paragraph. Non-GPL Code permitted under this -// exception must only link to the code of FRYSK through those well -// defined interfaces identified in the file named EXCEPTION found in -// the source code files (the "Approved Interfaces"). The files of -// Non-GPL Code may instantiate templates or use macros or inline -// functions from the Approved Interfaces without causing the -// resulting work to be covered by the GNU General Public -// License. Only Red Hat, Inc. may make changes or additions to the -// list of Approved Interfaces. You must obey the GNU General Public -// License in all respects for all of the FRYSK code and other code -// used in conjunction with FRYSK except the Non-GPL Code covered by -// this exception. If you modify this file, you may extend this -// exception to your version of the file, but you are not obligated to -// do so. If you do not wish to provide this exception without -// modification, you must delete this exception statement from your -// version and license this file solely under the GPL without -// exception. - -package frysk.proc; - -/** - * Light weight identifier. - * - * This implements comparable so can be used for searching and the - * like. Anything wanting to search for a task should use this. - */ - -class Id - implements Comparable -{ - /** - * XXX: Should not be public, but some code likes to poke it so - * that it has a re-usable ID. - */ - public int id; - protected Id () - { - id = -1; - } - protected Id (int id) - { - this.id = id; - } - /** - * From the point of view of IDs, is THIS class and the Object - * compatible? - * - * For the object hierarchy Task extends TaskId extends Id, Task - * and TaskId are considered compatible. - */ - protected boolean isCompatible (Object o) - { - return (o instanceof Id); - } - /** - * Is the object equals to this one. - */ - public boolean equals (Object o) - { - if (isCompatible (o)) - return ((Id)o).id == id; - else - return false; - } - /** - * Return the hash code for this ID (hash on the underlying ID - * value). - */ - public int hashCode () - { - return id; - } - /** - * Assuming that the two objects are the same, do a relative - * comparison. - */ - public int compareTo (Object o) - { - Id rhs = (Id)o; - // Should this be calling isCompatible? - return rhs.id - this.id; - } - /** - * Return a string representation of the object. - */ - public String toString () - { - return "" + id; - } -} diff --git a/frysk-core/frysk/proc/TaskId.java b/frysk-core/frysk/proc/TaskId.java index f347111..ac33b30 100644 --- a/frysk-core/frysk/proc/TaskId.java +++ b/frysk-core/frysk/proc/TaskId.java @@ -1,6 +1,6 @@ // This file is part of the program FRYSK. // -// Copyright 2005, 2006, 2007, Red Hat Inc. +// Copyright 2005, 2006, 2007, 2008, Red Hat Inc. // // FRYSK is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by @@ -45,33 +45,53 @@ package frysk.proc; * This implements comparable so can be used for searching and the * like. Anything wanting to search for a task should use this. */ - -public class TaskId - extends Id -{ - public TaskId () - { - super (); +class TaskId implements Comparable { + /** + * XXX: Should not be public, but some code likes to poke it so + * that it has a re-usable ID. + */ + public int id; + TaskId() { + id = -1; } - public TaskId (int id) - { - super (id); + TaskId(int id) { + this.id = id; } - public String toString () - { - return ("{TaskId," + super.toString () + "}"); + /** + * Is the object equals to this one. + */ + public boolean equals(Object o) { + if (o instanceof TaskId) + return ((TaskId)o).id == id; + else + return false; } - protected boolean isCompatible (Object o) - { - return (o instanceof TaskId); + /** + * Return the hash code for this ID (hash on the underlying ID + * value). + */ + public int hashCode() { + return id; + } + /** + * Assuming that the two objects are the same, do a relative + * comparison. + */ + public int compareTo(Object o) { + TaskId rhs = (TaskId)o; + return rhs.id - this.id; + } + /** + * Return a string representation of the object. + */ + public String toString() { + return ("{TaskId," + super.toString () + "}"); } - /** * Get the TID for this TaskID. * @return the TID */ - public int intValue() - { - return id; // field in superclass + public int intValue() { + return id; // field in superclass } } hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-02-27 21:19 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080227211945.22462.qmail@sourceware.org \ --to=cagney@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).