當前位置: 首頁>>代碼示例>>Python>>正文


Python Collections.unmodifiableList方法代碼示例

本文整理匯總了Python中java.util.Collections.unmodifiableList方法的典型用法代碼示例。如果您正苦於以下問題:Python Collections.unmodifiableList方法的具體用法?Python Collections.unmodifiableList怎麽用?Python Collections.unmodifiableList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.Collections的用法示例。


在下文中一共展示了Collections.unmodifiableList方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from java.util import Collections [as 別名]
# 或者: from java.util.Collections import unmodifiableList [as 別名]
  def __init__(self):
    self.speed = 5;
    self.speedZoom = .01;
    
    self.m_systemID = HashedString("RTSCameraSystem")

    #private final static List<HashedString> usedComponents;
    #private final static List<HashedString> optionalComponents;
    #private final static Set<HashedString> writeToComponents;
    #private final static Set<HashedString> otherComponents;
    #private final static Set<HashedString> usedInterfaces;
    #private final static Set<HashedString> writeToInterfaces;
  
  
    components = ArrayList()
    components.add(RTSCameraComponent.getComponentStaticType())
    self.m_usedComponents = Collections.unmodifiableList(components)
    
    components = ArrayList()
    components.add(CameraComponent.getComponentStaticType())
    self.m_optionalComponents = Collections.unmodifiableList(components)
    
    writes =  HashSet()
    writes.add(RTSCameraComponent.getComponentStaticType())
    writes.add(CameraComponent.getComponentStaticType())
    
    self.m_writeToComponents = Collections.unmodifiableSet(writes)
    
    self.m_otherComponents = Collections.emptySet()

    interfaces = HashSet()
    interfaces.add(SystemManager.inputInteface)
    self.m_usedInterfaces = Collections.unmodifiableSet(interfaces)
    self.m_writeToInterfaces = Collections.unmodifiableSet(HashSet(self.m_usedInterfaces))
開發者ID:Atridas,項目名稱:Antagonista,代碼行數:36,代碼來源:RTSCameraSystem.py

示例2: pyValToJavaObj

# 需要導入模塊: from java.util import Collections [as 別名]
# 或者: from java.util.Collections import unmodifiableList [as 別名]
def pyValToJavaObj(val):
    retObj = val   
    valtype = type(val) 
    if valtype is int:
        retObj = Integer(val)
    elif valtype is float:
        retObj = Float(val)
    elif valtype is long:
        retObj = Long(val)
    elif valtype is bool:
        retObj = Boolean(val)
    elif valtype is list:
        retObj = ArrayList()
        for i in val:
            retObj.add(pyValToJavaObj(i))
    elif valtype is tuple:
        tempList = ArrayList()
        for i in val:
            tempList.add(pyValToJavaObj(i))
        retObj = Collections.unmodifiableList(tempList)
    elif issubclass(valtype, dict):
        retObj = pyDictToJavaMap(val)
    elif issubclass(valtype, JavaWrapperClass):
        retObj = val.toJavaObj()
    return retObj
開發者ID:KeithLatteri,項目名稱:awips2,代碼行數:27,代碼來源:JUtil.py

示例3: getDependentSlots

# 需要導入模塊: from java.util import Collections [as 別名]
# 或者: from java.util.Collections import unmodifiableList [as 別名]
 def getDependentSlots(self):
     """ generated source for method getDependentSlots """
     return Collections.unmodifiableList(self.dependentSlots)
開發者ID:hobson,項目名稱:ggpy,代碼行數:5,代碼來源:MutableFunctionInfo.py

示例4: getImmutableCopy

# 需要導入模塊: from java.util import Collections [as 別名]
# 或者: from java.util.Collections import unmodifiableList [as 別名]
 def getImmutableCopy(cls, list_):
     """ generated source for method getImmutableCopy """
     return Collections.unmodifiableList(ArrayList(list_))
開發者ID:hobson,項目名稱:ggpy,代碼行數:5,代碼來源:GdlPool.py


注:本文中的java.util.Collections.unmodifiableList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。