DataItem.java
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
00003  * All rights reserved. This program is made available under the terms of the
00004  * Eclipse Public License v1.0 which accompanies this distribution, and is
00005  * available at http://www.eclipse.org/legal/epl-v10.html
00006  * Contributors:
00007  * General Robotix Inc.
00008  * National Institute of Advanced Industrial Science and Technology (AIST) 
00009  */
00010 package com.generalrobotix.ui.view.graph;
00011 
00018 public class DataItem {
00019 
00020     public final String object;     // オブジェクト名
00021     public final String node;       // ノード名
00022     public final String attribute;  // アトリビュート名
00023     public final int index;         // 添字
00024 
00025     final String fullName_;         // 完全名
00026     final String attributePath_;    // アトリビュートパス(添字なし)
00027     final String fullAttributeName_;
00028 
00029     // -----------------------------------------------------------------
00030     // コンストラクタ
00039     public DataItem(
00040         String object,
00041         String node,
00042         String attribute,
00043         int index,
00044         String nodeType
00045     ) {
00046         this.object = object;
00047         this.node = node;
00048         this.attribute = attribute;
00049         this.index = index;
00050 
00051         StringBuffer sb;
00052         if (object == null) {   // オブジェクト名なし?
00053             sb = new StringBuffer();    // オブジェクト名除外
00054         } else {    // オブジェクト名あり?
00055             sb = new StringBuffer(object);  // オブジェクト名付加
00056             sb.append(".");
00057         }
00058         sb.append(node);    // ノード
00059         sb.append(".");
00060         sb.append(attribute);   // アトリビュート
00061         attributePath_ = sb.toString();
00062         if (index >= 0) {       // 多次元?
00063             sb.append(".");
00064             sb.append(index);   // 添字
00065         }
00066         fullName_ = sb.toString();
00067         fullAttributeName_ = nodeType + "." + attribute;
00068     }
00069 
00077     public String toString() {
00078         return fullName_;
00079     }
00080 
00088     public String getAttributePath() {
00089         return attributePath_;
00090     }
00091 
00092     public String getFullAttributeName(){
00093         return fullAttributeName_;
00094     }
00095     
00101     public boolean isArray() {
00102         return (index >= 0);
00103     }
00104 }


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:16