我在哪里可以得到JOGL JAR?(Where do I get the JOGL JAR?)
这可能听起来很愚蠢......但我不知道在哪里可以找到JOGL JAR。 我搜查了他们的网站( http://jogamp.org/jogl/www/ )并找不到它。
有人可以帮忙吗?
谢谢
blargman
This might sound silly... but I don't know where to find the JOGL JAR. I searched their website (http://jogamp.org/jogl/www/) and couldn't find it.
Could someone please help?
Thank you
blargman
原文:https://stackoverflow.com/questions/6194824
最满意答案
取决于“命名构造函数”的含义,但是您可以重载构造函数请参阅Scala的Case Classes的重载构造函数?
你也可以把工厂方法放在你的类的Companion Objects(静态单例)中。
Depends what you mean with "named constructors", but yes you can overload constructors see Overload constructor for Scala's Case Classes?
Also you can put factory methods in a Companion Objects for your class (static singleton).
相关问答
更多-
用scala中的重载构造函数定义你自己的异常(define your own exceptions with overloaded constructors in scala)[2023-12-26]
cause默认值为空。 对于message它可以是cause.toString()或null: val e1 = new RuntimeException() e.getCause // res1: java.lang.Throwable = null e.getMessage //res2: java.lang.String = null val cause = new RuntimeException("cause msg") val e2 = new RuntimeException(cause ... -
Scala构造函数,命名参数和隐式获取器/设置器(Scala Constructors, Named Arguments, and Implicit Getters/Setters)[2022-03-21]
如果您尚未使用隐式转换来创建参数,则可以这样做: def validateName(s: String) = { if (s.length>0 && s(0).isUpper) s else throw new IllegalArgumentException(s+" is not a name!") } object Example { private[Example] class ValidatedName(val s: String) { } class Person(var fir ... -
Scala构造函数超载?(Scala constructor overload?)[2022-04-30]
值得明确提到的是,Scala中的辅助构造函数必须调用主构造函数(如在landon9720的)答案中,或者调用其他辅助构造函数作为第一个动作。 他们不能像Java那样简单地调用超类的构造函数来显式或隐式地调用它们。 这确保主构造函数是进入课程的唯一点。 class Foo(x: Int, y: Int, z: String) { // default y parameter to 0 def this(x: Int, z: String) = this(x, 0, z) // def ... -
在Scala中,我如何用多个构造函数子类化Java类?(In Scala, how can I subclass a Java class with multiple constructors?)[2023-08-11]
很容易忘记一个特征可能会扩展一个类。 如果你使用一个特征,你可以推迟调用哪个构造函数的决定,如下所示: trait Extended extends Base { ... } object Extended { def apply(arg1: Int) = new Base(arg1) with Extended def apply(arg2: String) = new Base(arg2) with Extended def apply(arg3: Double) = new Base ... -
在Scala中命名构造函数?(Named constructors in Scala?)[2023-04-20]
取决于“命名构造函数”的含义,但是您可以重载构造函数请参阅Scala的Case Classes的重载构造函数? 你也可以把工厂方法放在你的类的Companion Objects(静态单例)中。 Depends what you mean with "named constructors", but yes you can overload constructors see Overload constructor for Scala's Case Classes? Also you can put fact ... -
听起来你想要一个带有默认参数的构造函数: class example(val a : Vector[Int] = Vector()) Sounds like you want a constructor with a default argument: class example(val a : Vector[Int] = Vector())
-
在Scala构造函数中是否有相当于Java的这一点?(Is there an equivalent of Java's this in Scala constructors?)[2021-11-13]
斯卡拉让你的生活变得轻松: class Transition(val next: Int) val将使构造函数参数成为一个字段。 Scala makes your life easy: class Transition(val next: Int) The val will make the constructor parameter into a field. -
在scala中使用构造函数(Usage of constructors in scala)[2022-03-18]
默认构造函数确实存在 ,是的,它是整个类的主体。 而不是写作 class SeriousClass2(param: Param) { def this() { this(new Param()) } } 你最好只为默认构造函数提供默认值: class SeriousClass2(param: Param = new Param()) { } 它既惯用又更具可读性。 此外,有时您可能希望禁止从外部进行类实例化。 这可以通过指定构造函数范围进行存档: class Prett ... -
我不认为这是可能的,如果不诉诸运行时反射(或可能是宏)。 基本上有三个问题,你已经指出了两个问题: 特征不可能声明强制构造函数签名。 无法调用诸如apply A方法,因为它是类型变量而不是类或对象。 由于值类(当前)只能扩展通用特征 ,而不能扩展抽象类,因此无法使用TypeTags来获取属于在扩展Measurement时实例化A的类型的类。 我能想到的最好的方法是以下方法。 注意,它使用反射,并且如果Measurement的具体实例没有声明适当的构造函数,则可以在运行时抛出异常。 // ... as abo ...
-
Scala中的超类构造函数(Superclass constructors in scala)[2023-02-02]
是的, Array(s)表达式在运行时被评估。 class Foo (val x: Int) class Bar (x: Int, y: Int) extends Foo(x + y) Scala允许在对超类的构造函数的调用中使用表达式(类似于Java使用super(...)所做的)。 这些表达式在运行时进行评估。 Yes, the Array(s) expression is evaluated at run-time. class Foo (val x: Int) class Bar (x: Int, ...